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

Error(s) in loading state_dict for CRNN: #2

Closed
Bilgee opened this issue Mar 25, 2019 · 1 comment
Closed

Error(s) in loading state_dict for CRNN: #2

Bilgee opened this issue Mar 25, 2019 · 1 comment
Labels
question Further information is requested

Comments

@Bilgee
Copy link

Bilgee commented Mar 25, 2019

I downloaded and tested the pretrained densenet model, but it showed the error messages.

Error(s) in loading state_dict for CRNN:
Unexpected key(s) in state_dict: "features.1.denselayer1.norm1.num_batches_tracked", ...

@zhiqwang
Copy link
Owner

zhiqwang commented Mar 25, 2019

I guess you load the pretrained densenet121 model with the scripts python ./main.py --arch densenet121 --resume densenet121_pretrained.pth --test-only?

The pretrained model just contain the model.state_dict(), which is not the resume checkpoint of the script main.py (It also contain optimizer.state_dict()).

One way to use the pretrained model is demo.ipynb, or modify main.py to load the model with parameter model.load_state_dict(torch.load(PATH), strict=False).

@zhiqwang zhiqwang added the question Further information is requested label Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants