Skip to content

Commit

Permalink
Fix for solver issue pointed out by @moskewcz in #1972
Browse files Browse the repository at this point in the history
Use ReadNetParamsFromBinaryFileOrDie to read a net param when restoring
from a saved solverstate, which upgrades old nets, rather than
ReadProtoFromBinaryFile.
  • Loading branch information
jeffdonahue committed Mar 13, 2015
1 parent 4c090ae commit e46cf85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/caffe/solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ void Solver<Dtype>::Restore(const char* state_file) {
NetParameter net_param;
ReadProtoFromBinaryFile(state_file, &state);
if (state.has_learned_net()) {
ReadProtoFromBinaryFile(state.learned_net().c_str(), &net_param);
ReadNetParamsFromBinaryFileOrDie(state.learned_net().c_str(), &net_param);
net_->CopyTrainedLayersFrom(net_param);
}
iter_ = state.iter();
Expand Down

0 comments on commit e46cf85

Please sign in to comment.