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: "fc.weight", "fc.bias". #1

Open
chencheng1203 opened this issue Jan 13, 2020 · 2 comments
Open

Unexpected key(s) in state_dict: "fc.weight", "fc.bias". #1

chencheng1203 opened this issue Jan 13, 2020 · 2 comments

Comments

@chencheng1203
Copy link

chencheng1203 commented Jan 13, 2020

when training, in 'resnet.py' line 197, can not load weight

@VectXmy
Copy link
Owner

VectXmy commented Jan 13, 2020

the official pre-trained weights of resnet contains fc layer that we don't need. Therefore, you can modify line 197 as below: model.load_state_dict(model_zoo.load_url(model_urls['resnet50']),strict=False)

@chencheng1203
Copy link
Author

Thanks for reply!

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