question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RuntimeError: Error(s) in loading state_dict for SemGCN

See original GitHub issue

Thankyou for your work, I tried running the code using

python main_linear.py --evaluate checkpoint/pretrained/ckpt_linear.pth.tar

python main_gcn.py --evaluate checkpoint/pretrained/ckpt_semgcn.pth.tar
are working fine, but getting missing keys error for this run python main_gcn.py --non_local --evaluate checkpoint/pretrained/ckpt_semgcn_nonlocal.pth.tar

$ python main_gcn.py --non_local --evaluate checkpoint/pretrained/ckpt_semgcn_nonlocal.pth.tar ==> Using settings Namespace(actions='*', batch_size=64, checkpoint='checkpoint', dataset='h36m', downsample=1, dropout=0.0, epochs=100, evaluate='checkpoint/pretrained/ckpt_semgcn_nonlocal.pth.tar', hid_dim=128, keypoints='gt', lr=0.001, lr_decay=100000, lr_gamma=0.96, max_norm=True, non_local=True, num_layers=4, num_workers=8, resume='', snapshot=5) ==> Loading dataset... ==> Preparing data... ==> Loading 2D detections... ==> Creating model... ==> Total parameters: 0.43M ==> Loading checkpoint 'checkpoint/pretrained/ckpt_semgcn_nonlocal.pth.tar' Traceback (most recent call last): File "main_gcn.py", line 320, in <module> main(parse_args()) File "main_gcn.py", line 138, in main model_pos.load_state_dict(ckpt['state_dict']) File "/home/kirk/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/torch/nn/modules/module.py", line 839, in load_state_dict self.__class__.__name__, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for SemGCN: Missing key(s) in state_dict: "gconv_input.1.nonlocal1.g.0.weight", "gconv_input.1.nonlocal1.g.0.bias", "gconv_input.1.nonlocal1.theta.weight", "gconv_input.1.nonlocal1.theta.bias", "gconv_input.1.nonlocal1.phi.0.weight", "gconv_input.1.nonlocal1.phi.0.bias", "gconv_input.1.nonlocal1.concat_project.0.weight", "gconv_input.1.nonlocal1.W.0.weight", "gconv_input.1.nonlocal1.W.0.bias", "gconv_input.1.nonlocal1.W.1.weight", "gconv_input.1.nonlocal1.W.1.bias", "gconv_input.1.nonlocal1.W.1.running_mean", "gconv_input.1.nonlocal1.W.1.running_var", "gconv_layers.1.nonlocal1.g.0.weight", "gconv_layers.1.nonlocal1.g.0.bias", "gconv_layers.1.nonlocal1.theta.weight", "gconv_layers.1.nonlocal1.theta.bias", "gconv_layers.1.nonlocal1.phi.0.weight", "gconv_layers.1.nonlocal1.phi.0.bias", "gconv_layers.1.nonlocal1.concat_project.0.weight", "gconv_layers.1.nonlocal1.W.0.weight", "gconv_layers.1.nonlocal1.W.0.bias", "gconv_layers.1.nonlocal1.W.1.weight", "gconv_layers.1.nonlocal1.W.1.bias", "gconv_layers.1.nonlocal1.W.1.running_mean", "gconv_layers.1.nonlocal1.W.1.running_var", "gconv_layers.3.nonlocal1.g.0.weight", "gconv_layers.3.nonlocal1.g.0.bias", "gconv_layers.3.nonlocal1.theta.weight", "gconv_layers.3.nonlocal1.theta.bias", "gconv_layers.3.nonlocal1.phi.0.weight", "gconv_layers.3.nonlocal1.phi.0.bias", "gconv_layers.3.nonlocal1.concat_project.0.weight", "gconv_layers.3.nonlocal1.W.0.weight", "gconv_layers.3.nonlocal1.W.0.bias", "gconv_layers.3.nonlocal1.W.1.weight", "gconv_layers.3.nonlocal1.W.1.bias", "gconv_layers.3.nonlocal1.W.1.running_mean", "gconv_layers.3.nonlocal1.W.1.running_var", "gconv_layers.5.nonlocal1.g.0.weight", "gconv_layers.5.nonlocal1.g.0.bias", "gconv_layers.5.nonlocal1.theta.weight", "gconv_layers.5.nonlocal1.theta.bias", "gconv_layers.5.nonlocal1.phi.0.weight", "gconv_layers.5.nonlocal1.phi.0.bias", "gconv_layers.5.nonlocal1.concat_project.0.weight", "gconv_layers.5.nonlocal1.W.0.weight", "gconv_layers.5.nonlocal1.W.0.bias", "gconv_layers.5.nonlocal1.W.1.weight", "gconv_layers.5.nonlocal1.W.1.bias", "gconv_layers.5.nonlocal1.W.1.running_mean", "gconv_layers.5.nonlocal1.W.1.running_var", "gconv_layers.7.nonlocal1.g.0.weight", "gconv_layers.7.nonlocal1.g.0.bias", "gconv_layers.7.nonlocal1.theta.weight", "gconv_layers.7.nonlocal1.theta.bias", "gconv_layers.7.nonlocal1.phi.0.weight", "gconv_layers.7.nonlocal1.phi.0.bias", "gconv_layers.7.nonlocal1.concat_project.0.weight", "gconv_layers.7.nonlocal1.W.0.weight", "gconv_layers.7.nonlocal1.W.0.bias", "gconv_layers.7.nonlocal1.W.1.weight", "gconv_layers.7.nonlocal1.W.1.bias", "gconv_layers.7.nonlocal1.W.1.running_mean", "gconv_layers.7.nonlocal1.W.1.running_var". Unexpected key(s) in state_dict: "gconv_input.1.nonlocal.g.0.weight", "gconv_input.1.nonlocal.g.0.bias", "gconv_input.1.nonlocal.theta.weight", "gconv_input.1.nonlocal.theta.bias", "gconv_input.1.nonlocal.phi.0.weight", "gconv_input.1.nonlocal.phi.0.bias", "gconv_input.1.nonlocal.concat_project.0.weight", "gconv_input.1.nonlocal.W.0.weight", "gconv_input.1.nonlocal.W.0.bias", "gconv_input.1.nonlocal.W.1.weight", "gconv_input.1.nonlocal.W.1.bias", "gconv_input.1.nonlocal.W.1.running_mean", "gconv_input.1.nonlocal.W.1.running_var", "gconv_input.1.nonlocal.W.1.num_batches_tracked", "gconv_layers.1.nonlocal.g.0.weight", "gconv_layers.1.nonlocal.g.0.bias", "gconv_layers.1.nonlocal.theta.weight", "gconv_layers.1.nonlocal.theta.bias", "gconv_layers.1.nonlocal.phi.0.weight", "gconv_layers.1.nonlocal.phi.0.bias", "gconv_layers.1.nonlocal.concat_project.0.weight", "gconv_layers.1.nonlocal.W.0.weight", "gconv_layers.1.nonlocal.W.0.bias", "gconv_layers.1.nonlocal.W.1.weight", "gconv_layers.1.nonlocal.W.1.bias", "gconv_layers.1.nonlocal.W.1.running_mean", "gconv_layers.1.nonlocal.W.1.running_var", "gconv_layers.1.nonlocal.W.1.num_batches_tracked", "gconv_layers.3.nonlocal.g.0.weight", "gconv_layers.3.nonlocal.g.0.bias", "gconv_layers.3.nonlocal.theta.weight", "gconv_layers.3.nonlocal.theta.bias", "gconv_layers.3.nonlocal.phi.0.weight", "gconv_layers.3.nonlocal.phi.0.bias", "gconv_layers.3.nonlocal.concat_project.0.weight", "gconv_layers.3.nonlocal.W.0.weight", "gconv_layers.3.nonlocal.W.0.bias", "gconv_layers.3.nonlocal.W.1.weight", "gconv_layers.3.nonlocal.W.1.bias", "gconv_layers.3.nonlocal.W.1.running_mean", "gconv_layers.3.nonlocal.W.1.running_var", "gconv_layers.3.nonlocal.W.1.num_batches_tracked", "gconv_layers.5.nonlocal.g.0.weight", "gconv_layers.5.nonlocal.g.0.bias", "gconv_layers.5.nonlocal.theta.weight", "gconv_layers.5.nonlocal.theta.bias", "gconv_layers.5.nonlocal.phi.0.weight", "gconv_layers.5.nonlocal.phi.0.bias", "gconv_layers.5.nonlocal.concat_project.0.weight", "gconv_layers.5.nonlocal.W.0.weight", "gconv_layers.5.nonlocal.W.0.bias", "gconv_layers.5.nonlocal.W.1.weight", "gconv_layers.5.nonlocal.W.1.bias", "gconv_layers.5.nonlocal.W.1.running_mean", "gconv_layers.5.nonlocal.W.1.running_var", "gconv_layers.5.nonlocal.W.1.num_batches_tracked", "gconv_layers.7.nonlocal.g.0.weight", "gconv_layers.7.nonlocal.g.0.bias", "gconv_layers.7.nonlocal.theta.weight", "gconv_layers.7.nonlocal.theta.bias", "gconv_layers.7.nonlocal.phi.0.weight", "gconv_layers.7.nonlocal.phi.0.bias", "gconv_layers.7.nonlocal.concat_project.0.weight", "gconv_layers.7.nonlocal.W.0.weight", "gconv_layers.7.nonlocal.W.0.bias", "gconv_layers.7.nonlocal.W.1.weight", "gconv_layers.7.nonlocal.W.1.bias", "gconv_layers.7.nonlocal.W.1.running_mean", "gconv_layers.7.nonlocal.W.1.running_var", "gconv_layers.7.nonlocal.W.1.num_batches_tracked".

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
HDYYZDNcommented, Dec 7, 2020

model.load_state_dict(checkpoint[‘state_dict’], strict=False) 解决问题

3reactions
jujakosscommented, Apr 5, 2021

model.load_state_dict(checkpoint[‘state_dict’], strict=False) 解决问题

您好,打扰您了,这行代码加到哪里运行呢,谢谢,感激不尽 @SuperAttitude

in viz.py line 106 model_pos.load_state_dict(ckpt[‘state_dict’], strict=False)

Read more comments on GitHub >

github_iconTop Results From Across the Web

RuntimeError: Error(s) in loading state_dict for MLP
File "/opt/homebrew/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1604, in load_state_dict raise RuntimeError('Error(s) in ...
Read more >
Error(s) in loading state_dict for BertForTokenClassification
RuntimeError : Error(s) in loading state_dict for BertForTokenClassification: Hi,. I am trying to solve this error for so long, nothing ...
Read more >
Semantic Graph Convolutional Networks for 3D Human Pose ...
SemGCN learns to capture semantic information such as local and global node relationships, ... The code can be found at this https URL....
Read more >
RuntimeError: Error(s) in loading state_dict for - CSDN博客
1.在载入模型参数前加上:model = nn.DataParallel(model)2.更改torch版本部分原因是模型之间torch版本不匹配导致,加载使用模型时和训练模型时的环境 ...
Read more >
Raspi 2B blinks 7 times - Nextcloud/Nextcloudpi - IssueHint
RuntimeError : Error(s) in loading state_dict for SemGCN, 8, 2020-11-05, 2022-10-25. Changing `resource-path` raises error, 5, 2022-10-08, 2022-10-16.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found