This commit is contained in:
Evan Shelhamer 2015-01-23 22:49:38 -08:00
Родитель 6def482ead
Коммит fe8fe5f3a1
2 изменённых файлов: 3 добавлений и 6 удалений

Просмотреть файл

@ -139,8 +139,7 @@ int test() {
Caffe::set_mode(Caffe::CPU);
}
// Instantiate the caffe net.
Caffe::set_phase(Caffe::TEST);
Net<float> caffe_net(FLAGS_model);
Net<float> caffe_net(FLAGS_model, caffe::TEST);
caffe_net.CopyTrainedLayersFrom(FLAGS_weights);
LOG(INFO) << "Running for " << FLAGS_iterations << " iterations.";
@ -205,8 +204,7 @@ int time() {
Caffe::set_mode(Caffe::CPU);
}
// Instantiate the caffe net.
Caffe::set_phase(Caffe::TRAIN);
Net<float> caffe_net(FLAGS_model);
Net<float> caffe_net(FLAGS_model, caffe::TRAIN);
// Do a clean forward and backward pass, so that memory allocation are done
// and future iterations will be more stable.

Просмотреть файл

@ -64,7 +64,6 @@ int feature_extraction_pipeline(int argc, char** argv) {
LOG(ERROR) << "Using CPU";
Caffe::set_mode(Caffe::CPU);
}
Caffe::set_phase(Caffe::TEST);
arg_pos = 0; // the name of the executable
std::string pretrained_binary_proto(argv[++arg_pos]);
@ -98,7 +97,7 @@ int feature_extraction_pipeline(int argc, char** argv) {
*/
std::string feature_extraction_proto(argv[++arg_pos]);
shared_ptr<Net<Dtype> > feature_extraction_net(
new Net<Dtype>(feature_extraction_proto));
new Net<Dtype>(feature_extraction_proto, caffe::TEST));
feature_extraction_net->CopyTrainedLayersFrom(pretrained_binary_proto);
std::string extract_feature_blob_names(argv[++arg_pos]);