Hi,
here the example
import numpy as np
import torch
from torchvision.models import resnet18  # this model has batchnorm

net = resnet18(True)  # load pretrained model
inputs = np.random.randn(1, 3, 224, 224).astype(np.float32)
inputs = torch.autograd.Variable(torch.from_numpy(inputs), volatile=True)

# train=True
net.train(True)
Y1 = net(inputs)

# train=False
net.train(False)
Y2 = net(inputs)

# give different result
print Y1[0, :2]
print Y2[0, :2]

I know that model.train 34(mode=True/False) only affects dropout and batchnorm 9 layers. But, in the example of above, I think all the parameters are kept the same (even the affected batchnorm layer).
Does any body explain this issue?
Best