Hello. I’m not sure if I’m just unfamiliar with saving and loading Torch models, but I’m facing this predicament and am not sure how to proceed about it.
I’m currently wanting to load someone else’s model to try and run it. I downloaded their pt file that contains the model, and upon performing model = torch.load(PATH) I noticed that model is a dictionary with the keys model, opt, and optims.
I’ve never really seen that before, but I figured that the person saved the optimizer as well as the model’s weights. I assigned model['model'] to another variable, but when I tried to run the model via a output = model2(input) call I got a TypeError: 'collections.OrderedDict' object is not callable and realized that the weights were stored as an ordereddict.
How might I proceed to achieve what I want? I don’t have much experience with loading and using pre-trained models, but something tells me it should be relatively straightforward.