insightface icon indicating copy to clipboard operation
insightface copied to clipboard

The effect of pytorch checkpoint to running mean/var in Batchnorm Layer

Open HHCorp opened this issue 2 years ago • 0 comments

Hi, I've read some discussion(https://discuss.pytorch.org/t/checkpoint-with-batchnorm-running-averages/17738) about pytorch checkpoint. The running mean/var of BN layer seems update twice when checkpoint is used in training. The way to make batch statistic updating correct is changing momentum to (1 - sqrt(1- original momentum)). In the recognition project, It seems that the checkpoint is simply used without changing BN momentum. Will this affect the model training? Is it necessary to change momentum manually? @anxiangsir

HHCorp avatar Jul 20 '22 09:07 HHCorp