Skip to content

Commit

Permalink
display 'ignore source layer' when initializing from existing parameters
Browse files Browse the repository at this point in the history
This helps in the case to see which layer is initialized from existing parameters, and which layer is ignored. This helps identify the cases where the user types a error mismatch layer name.
  • Loading branch information
ronghanghu committed Nov 8, 2015
1 parent 0ec116e commit 0eea94a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/caffe/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ void Net<Dtype>::ShareTrainedLayersWith(const Net* other) {
++target_layer_id;
}
if (target_layer_id == layer_names_.size()) {
DLOG(INFO) << "Ignoring source layer " << source_layer_name;
LOG(INFO) << "Ignoring source layer " << source_layer_name;
continue;
}
DLOG(INFO) << "Copying source layer " << source_layer_name;
Expand Down Expand Up @@ -813,7 +813,7 @@ void Net<Dtype>::CopyTrainedLayersFrom(const NetParameter& param) {
++target_layer_id;
}
if (target_layer_id == layer_names_.size()) {
DLOG(INFO) << "Ignoring source layer " << source_layer_name;
LOG(INFO) << "Ignoring source layer " << source_layer_name;
continue;
}
DLOG(INFO) << "Copying source layer " << source_layer_name;
Expand Down Expand Up @@ -868,7 +868,7 @@ void Net<Dtype>::CopyTrainedLayersFromHDF5(const string trained_filename) {
for (int i = 0; i < num_layers; ++i) {
string source_layer_name = hdf5_get_name_by_idx(data_hid, i);
if (!layer_names_index_.count(source_layer_name)) {
DLOG(INFO) << "Ignoring source layer " << source_layer_name;
LOG(INFO) << "Ignoring source layer " << source_layer_name;
continue;
}
int target_layer_id = layer_names_index_[source_layer_name];
Expand Down

0 comments on commit 0eea94a

Please sign in to comment.