jwyang / faster-rcnn.pytorch

A faster pytorch implementation of faster r-cnn
MIT License
7.67k stars 2.33k forks source link

vgg.load_state_dict #182

Open rinawhale opened 6 years ago

rinawhale commented 6 years ago

Hi, when I run the program this error occurs, how can I solve it?

vgg.load_state_dict({k:v for k,v in state_dict.items() if k in vgg.state_dict()}) File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 494, in load_state_dict raise KeyError('missing keys in state_dict: "{}"'.format(missing)) KeyError: 'missing keys in state_dict: "set([\'classifier.1.bias\', \'classifier.1.weight\', \'classifier.4.weight\', \'classifier.4.bias\'])"'

jwyang commented 6 years ago

@rinawhale have you solved this issue?

LoFaiTh commented 6 years ago

hi, I run into this problem too. The pre-trained model has different keywords with the network. Have you solved this problem?

cwlinghk commented 6 years ago

I have the similar problem. Is that related to different version of torchvision??