Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected key(s) in state_dict: L2Norm.weight #105

Open
linhl97 opened this issue Jun 13, 2020 · 2 comments
Open

Unexpected key(s) in state_dict: L2Norm.weight #105

linhl97 opened this issue Jun 13, 2020 · 2 comments

Comments

@linhl97
Copy link

linhl97 commented Jun 13, 2020

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?

@imyangs
Copy link

imyangs commented Jan 4, 2021

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

@linhl97
Copy link
Author

linhl97 commented Jan 20, 2021

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants