Skip to content

Commit

Permalink
flownet2 patch: fix the error in hdf5 format model weights load.
Browse files Browse the repository at this point in the history
  • Loading branch information
vera121 committed Apr 23, 2018
1 parent db72704 commit 2b6a0b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/caffe/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ void Net<Dtype>::CopyTrainedLayersFromHDF5(const string trained_filename) {
}
}
hdf5_load_nd_dataset(layer_hid, dataset_name.c_str(), 0, kMaxBlobAxes,
target_blobs[j].get());
target_blobs[j].get(), true); //Allow reshape here, as we are loading data not params
}
H5Gclose(layer_hid);
}
Expand Down
2 changes: 1 addition & 1 deletion src/caffe/solvers/sgd_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ void SGDSolver<Dtype>::RestoreSolverStateFromHDF5(const string& state_file) {
ostringstream oss;
oss << i;
hdf5_load_nd_dataset<Dtype>(history_hid, oss.str().c_str(), 0,
kMaxBlobAxes, history_[i].get());
kMaxBlobAxes, history_[i].get(), true); //Allow reshape here, as we are loading data not params
}
H5Gclose(history_hid);
H5Fclose(file_hid);
Expand Down

0 comments on commit 2b6a0b9

Please sign in to comment.