PytorchSSD icon indicating copy to clipboard operation
PytorchSSD copied to clipboard

Unexpected key(s) in state_dict: L2Norm.weight

Open linhl97 opened this issue 5 years ago • 2 comments

Hi, I tried to using FSSD in live.py by adding the following code:

elif args.version == 'FSSD_vgg':  
    from models.FSSD_vgg import build_net

And I have downloaded the pretrained model FSSD_vgg_VOC_epoches_270.pth,but here comes the error:

RuntimeError: Error(s) in loading state_dict for FSSD:
        Unexpected key(s) in state_dict: "L2Norm.weight". 

How could I solve it?

linhl97 avatar Jun 13 '20 14:06 linhl97

replace net.load_state_dict(new_state_dict) with net.load_state_dict(new_state_dict, strict=False) in the train_test.py works for me

imyangs avatar Jan 04 '21 05:01 imyangs

replace net.load_state_dict(new_state_dict) with net.load_state_dict(new_state_dict, strict=False) in the train_test.py works for me

Thanks for your advice !

linhl97 avatar Jan 20 '21 11:01 linhl97