I tried to do what you advised, but I keep getting the same error.
Here’s my code:
model_transfer.load_state_dict(torch.load('model_transfer.pt'), map_location=lambda storage, loc: storage)
model_transfer.eval()