When you do net=torch.load(...) you are loading pretrained weights. It is just a python dictionary containing the weights, not the pytorch network. You need (in addition) to set a model (model= Model(*args,**kwargs) and then to load those weights into the model (model.load_state_dict(net))