I was using multiple gpu’s and was using nn.DataParallel at the wrong place. So my checkpoint saved the module with the key values, I solved it using the below way-
from collections import OrderedDict
new_state_dict = OrderedDict()
for k, v in state_dict.items():
 name = k[7:] # removemodule.``
 new_state_dict[name] = v
Now, you are using resnet, so I don’t know exactly how resnet behaves in mutli gpu settings.