We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c86433a + a19357a commit bc0d680Copy full SHA for bc0d680
src/caffe/util/upgrade_proto.cpp
@@ -1018,7 +1018,13 @@ void UpgradeNetBatchNorm(NetParameter* net_param) {
1018
// the previous BatchNorm layer definition.
1019
if (net_param->layer(i).type() == "BatchNorm"
1020
&& net_param->layer(i).param_size() == 3) {
1021
- net_param->mutable_layer(i)->clear_param();
+ // set lr_mult and decay_mult to zero. leave all other param intact.
1022
+ for (int ip = 0; ip < net_param->layer(i).param_size(); ip++) {
1023
+ ParamSpec* fixed_param_spec =
1024
+ net_param->mutable_layer(i)->mutable_param(ip);
1025
+ fixed_param_spec->set_lr_mult(0.f);
1026
+ fixed_param_spec->set_decay_mult(0.f);
1027
+ }
1028
}
1029
1030
0 commit comments