davidtvs / PyTorch-ENet

PyTorch implementation of ENet
MIT License
383 stars 129 forks source link

the question about torch.load() #52

Closed UnderTheMangoTree closed 3 years ago

UnderTheMangoTree commented 3 years ago

Thanks for your code which help me a lot. I want to segment my road figure, this is my test, not belong to any research or commodity. I wrote a new code. this code is just load the pre-trained model and use it to process my picture. But, when I load the model, the error arises. "_pickle.UnpicklingError: A load persistent id instruction was encountered, but no persistent_load function was specified."

i have searched some explanation, which one tells me this is because of verison of torch, but I am sure my version meets the requirements.

davidtvs commented 3 years ago

The only thing that comes to my mind is that I saved the pre-trained models with a recent PyTorch version (1.6 or maybe 1.7) and lower versions cannot load it.

What version of PyTorch are you using?

UnderTheMangoTree commented 3 years ago

Maybe this is the reason, the version of Pytorch i use is 1.2, i will retry the program with higher version. Thank you very much!(^_^)

davidtvs commented 3 years ago

@UnderTheMangoTree, FYI, I have just updated the pre-trained models, the new ones have been saved with PyTorch 1.1.0 so you should be able to load them with PyTorch 1.2 now