Is there any way to copy all parameters of one Pytorch model to another specially Batch Normalization mean and std?
I have found many correct ways online to copy one pytorch model parameters to another but somehow the copy-paste operation always misses the batch normalization parameters. Everything works fine as long as  I only use modules such as conv2d, linear, drop out, max pool etc in my model. But as soon as I add Batch normalization in pytorch model, the below-given script stop working and accuracy at test time is different :

net = model()
copy_net = model()

for param in net.module.parameters():
    copy_param.append(param.clone().detach())

count = 0
for param in copy_net.module.parameters():
    param.data =  copy_param[count]
    param.requires_grad = False
    count = count +1


Can anybody give me a possible solution to copying batch normalization also ?

net.load_state_dict(copy_net.state_dict()) should work.

As per @dxtx, in pytorch's philosophy, the state dict should cover all the states in a 'module',  e.g. in batch norm module , the running mean and var, if I remembered correctly, should be part of the state dict.
But in fact, if you wrote module like batch norm yourself, you have to override the 'state_dict' method.
