Load the weights from the specified caffemodel(s) into the train and test nets.
| 149 | // Load the weights from the specified caffemodel(s) into the train and |
| 150 | // test nets. |
| 151 | void CopyLayers(caffe::Solver<float>* solver, const std::string& model_list) { |
| 152 | std::vector<std::string> model_names; |
| 153 | boost::split(model_names, model_list, boost::is_any_of(",") ); |
| 154 | for (int i = 0; i < model_names.size(); ++i) { |
| 155 | LOG(INFO) << "Finetuning from " << model_names[i]; |
| 156 | solver->net()->CopyTrainedLayersFrom(model_names[i]); |
| 157 | for (int j = 0; j < solver->test_nets().size(); ++j) { |
| 158 | solver->test_nets()[j]->CopyTrainedLayersFrom(model_names[i]); |
| 159 | } |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | // Translate the signal effect the user specified on the command-line to the |
| 164 | // corresponding enumeration. |
no test coverage detected