RuntimeError: Error(s) in loading state_dict for SemGCN
See original GitHub issueThankyou 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:
- Created 3 years ago
- Comments:8 (1 by maintainers)
Top GitHub Comments
model.load_state_dict(checkpoint[‘state_dict’], strict=False) 解决问题
in viz.py line 106 model_pos.load_state_dict(ckpt[‘state_dict’], strict=False)