Solved by smth in post #2 
              
              
                There are limitations to loading pytorch model without code. 
First limitation: 
We only save the source code of the class definition. We do not save beyond that (like the package sources that the class is referring to). 
For example: 
import foo

class MyModel(...):
    def forward(input):
        …