Closed nihaomiao closed 6 years ago
running mean and variance would be constant because we use eval mode during training. (see here) The parameters of the batchnorm layer have no gradient because of this setting everywhere for batchnorm in model definition
Hello, setting model.eval() during training can fix running means and vars. But now I am a bit confused since this setting can also affect other layers. Do other layers can be trained and updated in setting "model.eval()"?
model.eval() only affects Batchnorm and dropout layer. Read more about this in pytorch docs. model.eval() is safe here because, there is no dropout layer in our model.
Thank you! Now I know that model.eval() doesn't turn off the history tracking..... Thanks a lot!
to stop pytorch from storing compute graph, use torch.no_grad()
Hello, do you implement the "frozen BN layers"? I find that running means still keep changing during training.