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

RuntimeError: Error(s) in loading state_dict for ResNet50_nFC #41

Open
cainiaoPCW opened this issue Mar 17, 2021 · 0 comments
Open

RuntimeError: Error(s) in loading state_dict for ResNet50_nFC #41

cainiaoPCW opened this issue Mar 17, 2021 · 0 comments

Comments

@cainiaoPCW
Copy link

run python3 inference.py test_sample/test_market.jpg --dataset market --model resnet50

RuntimeError: Error(s) in loading state_dict for ResNet50_nFC:
Missing key(s) in state_dict: "class_0.classifier.1.weight", "class_0.classifier.1.bias", "class_0.classifier.1.running_mean", "class_0.classifier.1.running_var", "class_0.classifier.4.weight", "class_0.classifier.4.bias", "class_1.classifier.1.weight", "class_1.classifier.1.bias", "class_1.classifier.1.running_mean", "class_1.classifier.1.running_var", "class_1.classifier.4.weight", "class_1.classifier.4.bias", "class_2.classifier.1.weight", "class_2.classifier.1.bias", "class_2.classifier.1.running_mean", "class_2.classifier.1.running_var", "class_2.classifier.4.weight", "class_2.classifier.4.bias", "class_3.classifier.1.weight", "class_3.classifier.1.bias", "class_3.classifier.1.running_mean", "class_3.classifier.1.running_var", "class_3.classifier.4.weight", "class_3.classifier.4.bias", "class_4.classifier.1.weight", "class_4.classifier.1.bias", "class_4.classifier.1.running_mean", "class_4.classifier.1.running_var", "class_4.classifier.4.weight", "class_4.classifier.4.bias", "class_5.classifier.1.weight", "class_5.classifier.1.bias", "class_5.classifier.1.running_mean", "class_5.classifier.1.running_var", "class_5.classifier.4.weight", "class_5.classifier.4.bias", "class_6.classifier.1.weight", "class_6.classifier.1.bias", "class_6.classifier.1.running_mean", "class_6.classifier.1.running_var", "class_6.classifier.4.weight", "class_6.classifier.4.bias", "class_7.classifier.1.weight", "class_7.classifier.1.bias", "class_7.classifier.1.running_mean", "class_7.classifier.1.running_var", "class_7.classifier.4.weight", "class_7.classifier.4.bias", "class_8.classifier.1.weight", "class_8.classifier.1.bias", "class_8.classifier.1.running_mean", "class_8.classifier.1.running_var", "class_8.classifier.4.weight", "class_8.classifier.4.bias", "class_9.classifier.1.weight", "class_9.classifier.1.bias", "class_9.classifier.1.running_mean", "class_9.classifier.1.running_var", "class_9.classifier.4.weight", "class_9.classifier.4.bias", "class_10.classifier.1.weight", "class_10.classifier.1.bias", "class_10.classifier.1.running_mean", "class_10.classifier.1.running_var", "class_10.classifier.4.weight", "class_10.classifier.4.bias", "class_11.classifier.1.weight", "class_11.classifier.1.bias", "class_11.classifier.1.running_mean", "class_11.classifier.1.running_var", "class_11.classifier.4.weight", "class_11.classifier.4.bias", "class_12.classifier.1.weight", "class_12.classifier.1.bias", "class_12.classifier.1.running_mean", "class_12.classifier.1.running_var", "class_12.classifier.4.weight", "class_12.classifier.4.bias", "class_13.classifier.1.weight", "class_13.classifier.1.bias", "class_13.classifier.1.running_mean", "class_13.classifier.1.running_var", "class_13.classifier.4.weight", "class_13.classifier.4.bias", "class_14.classifier.1.weight", "class_14.classifier.1.bias", "class_14.classifier.1.running_mean", "class_14.classifier.1.running_var", "class_14.classifier.4.weight", "class_14.classifier.4.bias", "class_15.classifier.1.weight", "class_15.classifier.1.bias", "class_15.classifier.1.running_mean", "class_15.classifier.1.running_var", "class_15.classifier.4.weight", "class_15.classifier.4.bias", "class_16.classifier.1.weight", "class_16.classifier.1.bias", "class_16.classifier.1.running_mean", "class_16.classifier.1.running_var", "class_16.classifier.4.weight", "class_16.classifier.4.bias", "class_17.classifier.1.weight", "class_17.classifier.1.bias", "class_17.classifier.1.running_mean", "class_17.classifier.1.running_var", "class_17.classifier.4.weight", "class_17.classifier.4.bias", "class_18.classifier.1.weight", "class_18.classifier.1.bias", "class_18.classifier.1.running_mean", "class_18.classifier.1.running_var", "class_18.classifier.4.weight", "class_18.classifier.4.bias", "class_19.classifier.1.weight", "class_19.classifier.1.bias", "class_19.classifier.1.running_mean", "class_19.classifier.1.running_var", "class_19.classifier.4.weight", "class_19.classifier.4.bias", "class_20.classifier.1.weight", "class_20.classifier.1.bias", "class_20.classifier.1.running_mean", "class_20.classifier.1.running_var", "class_20.classifier.4.weight", "class_20.classifier.4.bias", "class_21.classifier.1.weight", "class_21.classifier.1.bias", "class_21.classifier.1.running_mean", "class_21.classifier.1.running_var", "class_21.classifier.4.weight", "class_21.classifier.4.bias", "class_22.classifier.1.weight", "class_22.classifier.1.bias", "class_22.classifier.1.running_mean", "class_22.classifier.1.running_var", "class_22.classifier.4.weight", "class_22.classifier.4.bias", "class_23.classifier.0.weight", "class_23.classifier.0.bias", "class_23.classifier.1.weight", "class_23.classifier.1.bias", "class_23.classifier.1.running_mean", "class_23.classifier.1.running_var", "class_23.classifier.4.weight", "class_23.classifier.4.bias", "class_24.classifier.0.weight", "class_24.classifier.0.bias", "class_24.classifier.1.weight", "class_24.classifier.1.bias", "class_24.classifier.1.running_mean", "class_24.classifier.1.running_var", "class_24.classifier.4.weight", "class_24.classifier.4.bias", "class_25.classifier.0.weight", "class_25.classifier.0.bias", "class_25.classifier.1.weight", "class_25.classifier.1.bias", "class_25.classifier.1.running_mean", "class_25.classifier.1.running_var", "class_25.classifier.4.weight", "class_25.classifier.4.bias", "class_26.classifier.0.weight", "class_26.classifier.0.bias", "class_26.classifier.1.weight", "class_26.classifier.1.bias", "class_26.classifier.1.running_mean", "class_26.classifier.1.running_var", "class_26.classifier.4.weight", "class_26.classifier.4.bias", "class_27.classifier.0.weight", "class_27.classifier.0.bias", "class_27.classifier.1.weight", "class_27.classifier.1.bias", "class_27.classifier.1.running_mean", "class_27.classifier.1.running_var", "class_27.classifier.4.weight", "class_27.classifier.4.bias", "class_28.classifier.0.weight", "class_28.classifier.0.bias",
"class_28.classifier.1.weight", "class_28.classifier.1.bias", "class_28.classifier.1.running_mean", "class_28.classifier.1.running_var", "class_28.classifier.4.weight", "class_28.classifier.4.bias", "class_29.classifier.0.weight", "class_29.classifier.0.bias", "class_29.classifier.1.weight", "class_29.classifier.1.bias", "class_29.classifier.1.running_mean", "class_29.classifier.1.running_var", "class_29.classifier.4.weight", "class_29.classifier.4.bias".
Unexpected key(s) in state_dict: "class_0.add_block.0.weight", "class_0.add_block.0.bias", "class_0.add_block.1.weight", "class_0.add_block.1.bias", "class_0.add_block.1.running_mean", "class_0.add_block.1.running_var", "class_0.add_block.1.num_batches_tracked", "class_1.add_block.0.weight", "class_1.add_block.0.bias", "class_1.add_block.1.weight", "class_1.add_block.1.bias", "class_1.add_block.1.running_mean", "class_1.add_block.1.running_var", "class_1.add_block.1.num_batches_tracked", "class_2.add_block.0.weight", "class_2.add_block.0.bias", "class_2.add_block.1.weight", "class_2.add_block.1.bias", "class_2.add_block.1.running_mean", "class_2.add_block.1.running_var", "class_2.add_block.1.num_batches_tracked", "class_3.add_block.0.weight", "class_3.add_block.0.bias", "class_3.add_block.1.weight", "class_3.add_block.1.bias", "class_3.add_block.1.running_mean", "class_3.add_block.1.running_var", "class_3.add_block.1.num_batches_tracked", "class_4.add_block.0.weight", "class_4.add_block.0.bias", "class_4.add_block.1.weight", "class_4.add_block.1.bias", "class_4.add_block.1.running_mean", "class_4.add_block.1.running_var", "class_4.add_block.1.num_batches_tracked", "class_5.add_block.0.weight", "class_5.add_block.0.bias", "class_5.add_block.1.weight", "class_5.add_block.1.bias", "class_5.add_block.1.running_mean", "class_5.add_block.1.running_var", "class_5.add_block.1.num_batches_tracked", "class_6.add_block.0.weight", "class_6.add_block.0.bias", "class_6.add_block.1.weight", "class_6.add_block.1.bias", "class_6.add_block.1.running_mean", "class_6.add_block.1.running_var", "class_6.add_block.1.num_batches_tracked", "class_7.add_block.0.weight", "class_7.add_block.0.bias", "class_7.add_block.1.weight", "class_7.add_block.1.bias", "class_7.add_block.1.running_mean", "class_7.add_block.1.running_var", "class_7.add_block.1.num_batches_tracked", "class_8.add_block.0.weight", "class_8.add_block.0.bias", "class_8.add_block.1.weight", "class_8.add_block.1.bias", "class_8.add_block.1.running_mean", "class_8.add_block.1.running_var", "class_8.add_block.1.num_batches_tracked", "class_9.add_block.0.weight", "class_9.add_block.0.bias", "class_9.add_block.1.weight", "class_9.add_block.1.bias", "class_9.add_block.1.running_mean", "class_9.add_block.1.running_var", "class_9.add_block.1.num_batches_tracked", "class_10.add_block.0.weight", "class_10.add_block.0.bias", "class_10.add_block.1.weight", "class_10.add_block.1.bias", "class_10.add_block.1.running_mean", "class_10.add_block.1.running_var", "class_10.add_block.1.num_batches_tracked", "class_11.add_block.0.weight", "class_11.add_block.0.bias", "class_11.add_block.1.weight", "class_11.add_block.1.bias", "class_11.add_block.1.running_mean", "class_11.add_block.1.running_var", "class_11.add_block.1.num_batches_tracked", "class_12.add_block.0.weight", "class_12.add_block.0.bias", "class_12.add_block.1.weight", "class_12.add_block.1.bias", "class_12.add_block.1.running_mean", "class_12.add_block.1.running_var", "class_12.add_block.1.num_batches_tracked", "class_13.add_block.0.weight", "class_13.add_block.0.bias", "class_13.add_block.1.weight", "class_13.add_block.1.bias", "class_13.add_block.1.running_mean", "class_13.add_block.1.running_var", "class_13.add_block.1.num_batches_tracked", "class_14.add_block.0.weight", "class_14.add_block.0.bias", "class_14.add_block.1.weight", "class_14.add_block.1.bias", "class_14.add_block.1.running_mean", "class_14.add_block.1.running_var", "class_14.add_block.1.num_batches_tracked", "class_15.add_block.0.weight", "class_15.add_block.0.bias", "class_15.add_block.1.weight", "class_15.add_block.1.bias", "class_15.add_block.1.running_mean", "class_15.add_block.1.running_var", "class_15.add_block.1.num_batches_tracked", "class_16.add_block.0.weight", "class_16.add_block.0.bias", "class_16.add_block.1.weight", "class_16.add_block.1.bias", "class_16.add_block.1.running_mean", "class_16.add_block.1.running_var", "class_16.add_block.1.num_batches_tracked", "class_17.add_block.0.weight", "class_17.add_block.0.bias", "class_17.add_block.1.weight", "class_17.add_block.1.bias", "class_17.add_block.1.running_mean", "class_17.add_block.1.running_var", "class_17.add_block.1.num_batches_tracked", "class_18.add_block.0.weight", "class_18.add_block.0.bias", "class_18.add_block.1.weight", "class_18.add_block.1.bias", "class_18.add_block.1.running_mean", "class_18.add_block.1.running_var", "class_18.add_block.1.num_batches_tracked", "class_19.add_block.0.weight", "class_19.add_block.0.bias", "class_19.add_block.1.weight", "class_19.add_block.1.bias", "class_19.add_block.1.running_mean", "class_19.add_block.1.running_var", "class_19.add_block.1.num_batches_tracked", "class_20.add_block.0.weight", "class_20.add_block.0.bias", "class_20.add_block.1.weight", "class_20.add_block.1.bias", "class_20.add_block.1.running_mean", "class_20.add_block.1.running_var", "class_20.add_block.1.num_batches_tracked", "class_21.add_block.0.weight", "class_21.add_block.0.bias", "class_21.add_block.1.weight", "class_21.add_block.1.bias", "class_21.add_block.1.running_mean", "class_21.add_block.1.running_var", "class_21.add_block.1.num_batches_tracked", "class_22.add_block.0.weight", "class_22.add_block.0.bias", "class_22.add_block.1.weight", "class_22.add_block.1.bias", "class_22.add_block.1.running_mean", "class_22.add_block.1.running_var", "class_22.add_block.1.num_batches_tracked".
size mismatch for class_0.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_0.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in
current model is torch.Size([512]).
size mismatch for class_1.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_1.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in
current model is torch.Size([512]).
size mismatch for class_2.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_2.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in
current model is torch.Size([512]).
size mismatch for class_3.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_3.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in
current model is torch.Size([512]).
size mismatch for class_4.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_4.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in
current model is torch.Size([512]).
size mismatch for class_5.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_5.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in
current model is torch.Size([512]).
size mismatch for class_6.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_6.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in
current model is torch.Size([512]).
size mismatch for class_7.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_7.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in
current model is torch.Size([512]).
size mismatch for class_8.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_8.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in
current model is torch.Size([512]).
size mismatch for class_9.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_9.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in
current model is torch.Size([512]).
size mismatch for class_10.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_10.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for class_11.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_11.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for class_12.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_12.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for class_13.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_13.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for class_14.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_14.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for class_15.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_15.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for class_16.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_16.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for class_17.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_17.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for class_18.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_18.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for class_19.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_19.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for class_20.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_20.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for class_21.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_21.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for class_22.classifier.0.weight: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([512, 2048]).
size mismatch for class_22.classifier.0.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([512]).

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

1 participant