pytorch2caffe icon indicating copy to clipboard operation
pytorch2caffe copied to clipboard

"func.running_mean" doesn't equal to the corrsponding "base.bn1.running_mean" in resnet?

Open zouliangyu opened this issue 6 years ago • 2 comments

hi, I have tranformed a caffe model from a pytorch model, after transformation, I compared all the correspoding parameters between caffe and pytorch. Conv layer's(weights, bias) and BN layer's scale parameters are all right, but the running_mean, running_var in pytorch are not corresponding to base.bn1.running_mean, base.bn1.running_var, may I ask do you know why, thank you @longcw !!!

zouliangyu avatar Apr 16 '18 11:04 zouliangyu

Did you add model.eval() like this https://github.com/longcw/pytorch2caffe/blob/master/pytorch2caffe.py#L394. The running_mean will be updated in the training mode.

longcw avatar Jun 04 '18 10:06 longcw

@longcw Oh yes, THANKS, I forgot to add it to fix the mean and var ...

zouliangyu avatar Jun 14 '18 06:06 zouliangyu