It appears that the model keys are also inconsistent.
When you use the following codes:
cnn = models.vgg19()
cnn_state_dict = cnn.state_dict()
print(cnn_state_dict)
It gives you “features.0.weight”
And if you load a previously trained model,
checkpoint = torch.load(‘models/checkpoint.pth.tar’)
print(checkpoint[‘state_dict’].keys())
Then it will give you “KeyError: ‘unexpected key “features.module.0.weight” in state_dict’”. What are the solutions for this one?