Seems like you have an extra ‘module.’ in your saved model.
in the example above you are saving DataParallel model and loading it into MyModel, the similar issue was discussed here
  
      github.com/pytorch/pytorch
  
  
    
  
	  
  

  
    
      torch.save() and nn.DataParallel() 3
    

    
      
        opened 
        
          
        
        Jul 5, 2018
      
      

        
          closed 
        
          
        
        Jul 9, 2018
      
        

      
        
          
          linzhiqiu
        
      
    
  



  As pointed out in this post, when model is trained using DataParallel(), the saved model state_dict will have prefix "module." before...