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

Model load error #7

Open
lucasjinreal opened this issue Nov 16, 2018 · 1 comment
Open

Model load error #7

lucasjinreal opened this issue Nov 16, 2018 · 1 comment

Comments

@lucasjinreal
Copy link

Hi, I am current test linknet on pytorch 0.41, but the model trained can not load to test:

ile "demo.py", line 95, in predict
    model.load_state_dict(m['state_dict'])
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 719, in load_state_dict
    self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for LinkNet:
	Missing key(s) in state_dict: "in_block.0.weight", "in_block.1.weight", "in_block.1.bias", "in_block.1.running_mean", "in_block.1.running_var", "encoder1.0.conv1.weight",

Many thanks if any clue can be provide!
BTW, the model can be resume which is really wierd.....

@codeAC29
Copy link
Contributor

codeAC29 commented Nov 21, 2018

This model was trained an older version of PyTorch (may be 0.2x). Most likely you will have to create a new dictionary and copy the weights one by one for each layer with updated keys.

@codeAC29 codeAC29 reopened this Nov 21, 2018
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