Hi everyone  I am new to pytorch and there’s one issue that really confuses me
When I try to use transfer learning  and take the resnet50 as base from this link
vision/torchvision/models/resnet.py 
And download the weight from resnet50-19c8e357.pth 2
Here’s the problems:
While I am initializing the weights from pretrained model I first check if “all model’s layer match pretrained model’s key” ,so here’s what I do:
model_resnet = resnet50() #this is built completely same as  the link above
resnet50_weights = torch.load("resnet50-19c8e357.pth") 

#get all layer name from model_resnet
names = {}
for name,param in model_resnet.named_parameters():
    names[name] = 0

#to see if there's anything missing
for key in resnet50_weights:
    if key not in names:
        print(key)

And the output be like:
bn1.running_mean
bn1.running_var
layer1.0.bn1.running_mean
layer1.0.bn1.running_var
layer1.0.bn2.running_mean
layer1.0.bn2.running_var
layer1.0.bn3.running_mean
layer1.0.bn3.running_var
layer1.0.downsample.1.running_mean
layer1.0.downsample.1.running_var
layer1.1.bn1.running_mean
layer1.1.bn1.running_var
layer1.1.bn2.running_mean
layer1.1.bn2.running_var
layer1.1.bn3.running_mean
layer1.1.bn3.running_var
layer1.2.bn1.running_mean
layer1.2.bn1.running_var
layer1.2.bn2.running_mean
layer1.2.bn2.running_var
layer1.2.bn3.running_mean
layer1.2.bn3.running_var
layer2.0.bn1.running_mean
layer2.0.bn1.running_var
layer2.0.bn2.running_mean
layer2.0.bn2.running_var
layer2.0.bn3.running_mean
layer2.0.bn3.running_var
layer2.0.downsample.1.running_mean
layer2.0.downsample.1.running_var
layer2.1.bn1.running_mean
layer2.1.bn1.running_var
layer2.1.bn2.running_mean
layer2.1.bn2.running_var
layer2.1.bn3.running_mean
layer2.1.bn3.running_var
layer2.2.bn1.running_mean
layer2.2.bn1.running_var
layer2.2.bn2.running_mean
layer2.2.bn2.running_var
layer2.2.bn3.running_mean
layer2.2.bn3.running_var
layer2.3.bn1.running_mean
layer2.3.bn1.running_var
layer2.3.bn2.running_mean
layer2.3.bn2.running_var
layer2.3.bn3.running_mean
layer2.3.bn3.running_var
layer3.0.bn1.running_mean
layer3.0.bn1.running_var
layer3.0.bn2.running_mean
layer3.0.bn2.running_var
layer3.0.bn3.running_mean
layer3.0.bn3.running_var
layer3.0.downsample.1.running_mean
layer3.0.downsample.1.running_var
layer3.1.bn1.running_mean
layer3.1.bn1.running_var
layer3.1.bn2.running_mean
layer3.1.bn2.running_var
layer3.1.bn3.running_mean
layer3.1.bn3.running_var
layer3.2.bn1.running_mean
layer3.2.bn1.running_var
layer3.2.bn2.running_mean
layer3.2.bn2.running_var
layer3.2.bn3.running_mean
layer3.2.bn3.running_var
layer3.3.bn1.running_mean
layer3.3.bn1.running_var
layer3.3.bn2.running_mean
layer3.3.bn2.running_var
layer3.3.bn3.running_mean
layer3.3.bn3.running_var
layer3.4.bn1.running_mean
layer3.4.bn1.running_var
layer3.4.bn2.running_mean
layer3.4.bn2.running_var
layer3.4.bn3.running_mean
layer3.4.bn3.running_var
layer3.5.bn1.running_mean
layer3.5.bn1.running_var
layer3.5.bn2.running_mean
layer3.5.bn2.running_var
layer3.5.bn3.running_mean
layer3.5.bn3.running_var
layer4.0.bn1.running_mean
layer4.0.bn1.running_var
layer4.0.bn2.running_mean
layer4.0.bn2.running_var
layer4.0.bn3.running_mean
layer4.0.bn3.running_var
layer4.0.downsample.1.running_mean
layer4.0.downsample.1.running_var
layer4.1.bn1.running_mean
layer4.1.bn1.running_var
layer4.1.bn2.running_mean
layer4.1.bn2.running_var
layer4.1.bn3.running_mean
layer4.1.bn3.running_var
layer4.2.bn1.running_mean
layer4.2.bn1.running_var
layer4.2.bn2.running_mean
layer4.2.bn2.running_var
layer4.2.bn3.running_mean
layer4.2.bn3.running_var

As far as I know,when we freeze the pretrained model,one of issue is that we need to be careful about either using batch statistics or running mean&var that calculated while using transfer learning ,I think we should use the running mean&var as we “freeze” the model like the link below also mentioned:
The Batch Normalization layer of Keras is broken 4
Anyone has any idea how do we get running_mean&var?