Solved by ptrblck in post #2 
              
              
                You are only saving the parameters in these lines of code: 
names = {}
for name,param in model_resnet.named_parameters():
    names[name] = 0

while the running estimates are stored as buffers. 
You could append these buffers using: 
for name, buf in model_resnet.named_buffers():
    names[name] = 0…