Sure, I was looking at super resolution githubs with pytorch.
One of the ones I grabbed was https://github.com/BUPTLdy/Pytorch-LapSRN 24.
Download it and run the python test.py on torch ‘1.0.1.post2’ (version im currently working with) this error will occur.
Clearly, the author should have saved a state_dict, but they saved the entire model instead.
The fix is quite simple, for this one, on a separate script load the entire model as in test.py then save state state dict as per the serialization docs, then change test.py to load the model class then load the state dict you just saved.
So, if one follows the recommended serialization proc then everything works, but in many cases this isn’t done, because its in human nature to take the perceived simpler path. All Im just arguing that pytorch could have a more comprehensive error tolerant serialization.
btw. not related; a much better written superresolution github is ESRGAN 14 - curiously it isnt in modelzoo.