I am facing the same error, for vgg 13 and 19. These two websites talks about this problem, but I have not yet tested on it. I am not sure about if this applies to vgg 13 also. BTW, vgg11 and 16 does not have this problem.

  
    
    
    Upgrading torchvision module makes old model useless? vision
  
  
    Once upon a time, I downloaded the vgg models by jonhson and loaded with torchvision.models.vgg16/19 without a problem. 
Lately, I pip upgraded torchvision modules, and the same old vgg models fail to load, error goes like: 
KeyError: 'unexpected key "classifier.1.weight" in state_dict' 
Then I check stat_dict of current upgraded torchvision.models.vgg19, goes like this: 
In [5]: v19.state_dict().keys() 
Out[5]: odict_keys([‘features.0.weight’, ‘features.0.bias’, ‘features.2.weight’, ‘features.2…
  



  
      github.com/jcjohnson/pytorch-vgg
  
  
    



Issue: vgg model checkpoint needs a change of classifier weight names 57


	
	opened by soumith
	on 2017-04-08
	
	
	


See https://discuss.pytorch.org/t/upgrading-torchvision-module-makes-old-model-useless/1719
The reason this changed was because of pytorch/vision#107 where Sam realized that he put dropout in the wrong location.
So the...