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

Missing and Unexpected key(s) in state_dict #64

Open
ssy248 opened this issue Jul 22, 2021 · 1 comment
Open

Missing and Unexpected key(s) in state_dict #64

ssy248 opened this issue Jul 22, 2021 · 1 comment

Comments

@ssy248
Copy link

ssy248 commented Jul 22, 2021

When I run the command from the homepage
python main.py --input ./input --video_root ./videos --output ./output.json --model wideresnet-50-kinetics.pth --mode score

after I saved the wideresnet-50-kinetics.pth model to the same folder as main.py, I still have the errors of

Missing key(s) in state_dict: "conv1.weight", "bn1.weight", "bn1.bias", "bn1.running_mean", "bn1.running_var", "layer1.0.conv1.weight", "layer1.0.bn1.weight", "layer1.0.bn1.bias", "layer1.0.bn1.running_mean", "layer1.0.bn1.running_var", "layer1.0.conv2.weight", ....
and
Unexpected key(s) in state_dict: "module.conv1.weight", "module.bn1.weight", "module.bn1.bias", "module.bn1.running_mean", "module.bn1.running_var", "module.layer1.0.conv1.weight", "module.layer1.0.bn1.weight", "module.layer1.0.bn1.bias", "module.layer1.0.bn1.running_mean", ...

Why do the keys from the correct model not match ?

@dhruvgrover1251
Copy link

Hi,
I think the model you are using is trained on multiple GPU (using nn.DataParallel), I was able to solve this either by removing "module." from the keys or by using the CPU version.
Thank You!

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