zhanghang1989 / PyTorch-Encoding

A CV toolkit for my papers.
https://hangzhang.org/PyTorch-Encoding/
MIT License
2.04k stars 452 forks source link

RuntimeError: Error(s) in loading state_dict for Net #100

Open Xiuyu-Li opened 6 years ago

Xiuyu-Li commented 6 years ago

Hi Mr. Zhang: When I test pre-trained model on MINC-2500 using: python main.py --dataset minc --model deepten --nclass 23 --resume deepten_minc.pth --eval, I got the following errors:

=> loading checkpoint 'deepten_minc.pth'
Traceback (most recent call last):
  File "main.py", line 174, in <module>
    main()
  File "main.py", line 72, in main
    model.load_state_dict(checkpoint['state_dict'])
  File "/Users/pro/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 719, in load_state_dict
    self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for Net:
    Missing key(s) in state_dict: "pretrained.conv1.weight", "pretrained.bn1.weight", "pretrained.bn1.bias", "pretrained.bn1.running_mean", "pretrained.bn1.running_var", "pretrained.layer1.0.conv1.weight", "pretrained.layer1.0.bn1.weight", "pretrained.layer1.0.bn1.bias", "pretrained.layer1.0.bn1.running_mean", "pretrained.layer1.0.bn1.running_var", "pretrained.layer1.0.conv2.weight", "pretrained.layer1.0.bn2.weight", "pretrained.layer1.0.bn2.bias", "pretrained.layer1.0.bn2.running_mean", "pretrained.layer1.0.bn2.running_var", "pretrained.layer1.0.conv3.weight", "pretrained.layer1.0.bn3.weight", "pretrained.layer1.0.bn3.bias", "pretrained.layer1.0.bn3.running_mean", "pretrained.layer1.0.bn3.running_var", "pretrained.layer1.0.downsample.0.weight", "pretrained.layer1.0.downsample.1.weight", "pretrained.layer1.0.downsample.1.bias", "pretrained.layer1.0.downsample.1.running_mean", "pretrained.layer1.0.downsample.1.running_var", "pretrained.layer1.1.conv1.weight", "pretrained.layer1.1.bn1.weight", "pretrained.layer1.1.bn1.bias", "pretrained.layer1.1.bn1.running_mean", "pretrained.layer1.1.bn1.running_var", "pretrained.layer1.1.conv2.weight", "pretrained.layer1.1.bn2.weight", "pretrained.layer1.1.bn2.bias", "pretrained.layer1.1.bn2.running_mean", "pretrained.layer1.1.bn2.running_var", "pretrained.layer1.1.conv3.weight", "pretrained.layer1.1.bn3.weight", "pretrained.layer1.1.bn3.bias", "pretrained.layer1.1.bn3.running_mean", "pretrained.layer1.1.bn3.running_var", "pretrained.layer1.2.conv1.weight", "pretrained.layer1.2.bn1.weight", "pretrained.layer1.2.bn1.bias", "pretrained.layer1.2.bn1.running_mean", "pretrained.layer1.2.bn1.running_var", "pretrained.layer1.2.conv2.weight", "pretrained.layer1.2.bn2.weight", "pretrained.layer1.2.bn2.bias", "pretrained.layer1.2.bn2.running_mean", "pretrained.layer1.2.bn2.running_var", "pretrained.layer1.2.conv3.weight", "pretrained.layer1.2.bn3.weight", "pretrained.layer1.2.bn3.bias", "pretrained.layer1.2.bn3.running_mean", "pretrained.layer1.2.bn3.running_var", "pretrained.layer2.0.conv1.weight", "pretrained.layer2.0.bn1.weight", "pretrained.layer2.0.bn1.bias", "pretrained.layer2.0.bn1.running_mean", "pretrained.layer2.0.bn1.running_var", "pretrained.layer2.0.conv2.weight", "pretrained.layer2.0.bn2.weight", "pretrained.layer2.0.bn2.bias", "pretrained.layer2.0.bn2.running_mean", "pretrained.layer2.0.bn2.running_var", "pretrained.layer2.0.conv3.weight", "pretrained.layer2.0.bn3.weight", "pretrained.layer2.0.bn3.bias", "pretrained.layer2.0.bn3.running_mean", "pretrained.layer2.0.bn3.running_var", "pretrained.layer2.0.downsample.0.weight", "pretrained.layer2.0.downsample.1.weight", "pretrained.layer2.0.downsample.1.bias", "pretrained.layer2.0.downsample.1.running_mean", "pretrained.layer2.0.downsample.1.running_var", "pretrained.layer2.1.conv1.weight", "pretrained.layer2.1.bn1.weight", "pretrained.layer2.1.bn1.bias", "pretrained.layer2.1.bn1.running_mean", "pretrained.layer2.1.bn1.running_var", "pretrained.layer2.1.conv2.weight", "pretrained.layer2.1.bn2.weight", "pretrained.layer2.1.bn2.bias", "pretrained.layer2.1.bn2.running_mean", "pretrained.layer2.1.bn2.running_var", "pretrained.layer2.1.conv3.weight", "pretrained.layer2.1.bn3.weight", "pretrained.layer2.1.bn3.bias", "pretrained.layer2.1.bn3.running_mean", "pretrained.layer2.1.bn3.running_var", "pretrained.layer2.2.conv1.weight", "pretrained.layer2.2.bn1.weight", "pretrained.layer2.2.bn1.bias", "pretrained.layer2.2.bn1.running_mean", "pretrained.layer2.2.bn1.running_var", "pretrained.layer2.2.conv2.weight", "pretrained.layer2.2.bn2.weight", "pretrained.layer2.2.bn2.bias", "pretrained.layer2.2.bn2.running_mean", "pretrained.layer2.2.bn2.running_var", "pretrained.layer2.2.conv3.weight", "pretrained.layer2.2.bn3.weight", "pretrained.layer2.2.bn3.bias", "pretrained.layer2.2.bn3.running_mean", "pretrained.layer2.2.bn3.running_var", "pretrained.layer2.3.conv1.weight", "pretrained.layer2.3.bn1.weight", "pretrained.layer2.3.bn1.bias", "pretrained.layer2.3.bn1.running_mean", "pretrained.layer2.3.bn1.running_var", "pretrained.layer2.3.conv2.weight", "pretrained.layer2.3.bn2.weight", "pretrained.layer2.3.bn2.bias", "pretrained.layer2.3.bn2.running_mean", "pretrained.layer2.3.bn2.running_var", "pretrained.layer2.3.conv3.weight", "pretrained.layer2.3.bn3.weight", "pretrained.layer2.3.bn3.bias", "pretrained.layer2.3.bn3.running_mean", "pretrained.layer2.3.bn3.running_var", "pretrained.layer3.0.conv1.weight", "pretrained.layer3.0.bn1.weight", "pretrained.layer3.0.bn1.bias", "pretrained.layer3.0.bn1.running_mean", "pretrained.layer3.0.bn1.running_var", "pretrained.layer3.0.conv2.weight", "pretrained.layer3.0.bn2.weight", "pretrained.layer3.0.bn2.bias", "pretrained.layer3.0.bn2.running_mean", "pretrained.layer3.0.bn2.running_var", "pretrained.layer3.0.conv3.weight", "pretrained.layer3.0.bn3.weight", "pretrained.layer3.0.bn3.bias", "pretrained.layer3.0.bn3.running_mean", "pretrained.layer3.0.bn3.running_var", "pretrained.layer3.0.downsample.0.weight", "pretrained.layer3.0.downsample.1.weight", "pretrained.layer3.0.downsample.1.bias", "pretrained.layer3.0.downsample.1.running_mean", "pretrained.layer3.0.downsample.1.running_var", "pretrained.layer3.1.conv1.weight", "pretrained.layer3.1.bn1.weight", "pretrained.layer3.1.bn1.bias", "pretrained.layer3.1.bn1.running_mean", "pretrained.layer3.1.bn1.running_var", "pretrained.layer3.1.conv2.weight", "pretrained.layer3.1.bn2.weight", "pretrained.layer3.1.bn2.bias", "pretrained.layer3.1.bn2.running_mean", "pretrained.layer3.1.bn2.running_var", "pretrained.layer3.1.conv3.weight", "pretrained.layer3.1.bn3.weight", "pretrained.layer3.1.bn3.bias", "pretrained.layer3.1.bn3.running_mean", "pretrained.layer3.1.bn3.running_var", "pretrained.layer3.2.conv1.weight", "pretrained.layer3.2.bn1.weight", "pretrained.layer3.2.bn1.bias", "pretrained.layer3.2.bn1.running_mean", "pretrained.layer3.2.bn1.running_var", "pretrained.layer3.2.conv2.weight", "pretrained.layer3.2.bn2.weight", "pretrained.layer3.2.bn2.bias", "pretrained.layer3.2.bn2.running_mean", "pretrained.layer3.2.bn2.running_var", "pretrained.layer3.2.conv3.weight", "pretrained.layer3.2.bn3.weight", "pretrained.layer3.2.bn3.bias", "pretrained.layer3.2.bn3.running_mean", "pretrained.layer3.2.bn3.running_var", "pretrained.layer3.3.conv1.weight", "pretrained.layer3.3.bn1.weight", "pretrained.layer3.3.bn1.bias", "pretrained.layer3.3.bn1.running_mean", "pretrained.layer3.3.bn1.running_var", "pretrained.layer3.3.conv2.weight", "pretrained.layer3.3.bn2.weight", "pretrained.layer3.3.bn2.bias", "pretrained.layer3.3.bn2.running_mean", "pretrained.layer3.3.bn2.running_var", "pretrained.layer3.3.conv3.weight", "pretrained.layer3.3.bn3.weight", "pretrained.layer3.3.bn3.bias", "pretrained.layer3.3.bn3.running_mean", "pretrained.layer3.3.bn3.running_var", "pretrained.layer3.4.conv1.weight", "pretrained.layer3.4.bn1.weight", "pretrained.layer3.4.bn1.bias", "pretrained.layer3.4.bn1.running_mean", "pretrained.layer3.4.bn1.running_var", "pretrained.layer3.4.conv2.weight", "pretrained.layer3.4.bn2.weight", "pretrained.layer3.4.bn2.bias", "pretrained.layer3.4.bn2.running_mean", "pretrained.layer3.4.bn2.running_var", "pretrained.layer3.4.conv3.weight", "pretrained.layer3.4.bn3.weight", "pretrained.layer3.4.bn3.bias", "pretrained.layer3.4.bn3.running_mean", "pretrained.layer3.4.bn3.running_var", "pretrained.layer3.5.conv1.weight", "pretrained.layer3.5.bn1.weight", "pretrained.layer3.5.bn1.bias", "pretrained.layer3.5.bn1.running_mean", "pretrained.layer3.5.bn1.running_var", "pretrained.layer3.5.conv2.weight", "pretrained.layer3.5.bn2.weight", "pretrained.layer3.5.bn2.bias", "pretrained.layer3.5.bn2.running_mean", "pretrained.layer3.5.bn2.running_var", "pretrained.layer3.5.conv3.weight", "pretrained.layer3.5.bn3.weight", "pretrained.layer3.5.bn3.bias", "pretrained.layer3.5.bn3.running_mean", "pretrained.layer3.5.bn3.running_var", "pretrained.layer4.0.conv1.weight", "pretrained.layer4.0.bn1.weight", "pretrained.layer4.0.bn1.bias", "pretrained.layer4.0.bn1.running_mean", "pretrained.layer4.0.bn1.running_var", "pretrained.layer4.0.conv2.weight", "pretrained.layer4.0.bn2.weight", "pretrained.layer4.0.bn2.bias", "pretrained.layer4.0.bn2.running_mean", "pretrained.layer4.0.bn2.running_var", "pretrained.layer4.0.conv3.weight", "pretrained.layer4.0.bn3.weight", "pretrained.layer4.0.bn3.bias", "pretrained.layer4.0.bn3.running_mean", "pretrained.layer4.0.bn3.running_var", "pretrained.layer4.0.downsample.0.weight", "pretrained.layer4.0.downsample.1.weight", "pretrained.layer4.0.downsample.1.bias", "pretrained.layer4.0.downsample.1.running_mean", "pretrained.layer4.0.downsample.1.running_var", "pretrained.layer4.1.conv1.weight", "pretrained.layer4.1.bn1.weight", "pretrained.layer4.1.bn1.bias", "pretrained.layer4.1.bn1.running_mean", "pretrained.layer4.1.bn1.running_var", "pretrained.layer4.1.conv2.weight", "pretrained.layer4.1.bn2.weight", "pretrained.layer4.1.bn2.bias", "pretrained.layer4.1.bn2.running_mean", "pretrained.layer4.1.bn2.running_var", "pretrained.layer4.1.conv3.weight", "pretrained.layer4.1.bn3.weight", "pretrained.layer4.1.bn3.bias", "pretrained.layer4.1.bn3.running_mean", "pretrained.layer4.1.bn3.running_var", "pretrained.layer4.2.conv1.weight", "pretrained.layer4.2.bn1.weight", "pretrained.layer4.2.bn1.bias", "pretrained.layer4.2.bn1.running_mean", "pretrained.layer4.2.bn1.running_var", "pretrained.layer4.2.conv2.weight", "pretrained.layer4.2.bn2.weight", "pretrained.layer4.2.bn2.bias", "pretrained.layer4.2.bn2.running_mean", "pretrained.layer4.2.bn2.running_var", "pretrained.layer4.2.conv3.weight", "pretrained.layer4.2.bn3.weight", "pretrained.layer4.2.bn3.bias", "pretrained.layer4.2.bn3.running_mean", "pretrained.layer4.2.bn3.running_var", "pretrained.fc.weight", "pretrained.fc.bias", "head.0.weight", "head.0.bias", "head.1.weight", "head.1.bias", "head.1.running_mean", "head.1.running_var", "head.3.codewords", "head.3.scale", "head.6.weight", "head.6.bias".
    Unexpected key(s) in state_dict: "module.pretrained.conv1.weight", "module.pretrained.bn1.weight", "module.pretrained.bn1.bias", "module.pretrained.bn1.running_mean", "module.pretrained.bn1.running_var", "module.pretrained.bn1.num_batches_tracked", "module.pretrained.layer1.0.conv1.weight", "module.pretrained.layer1.0.bn1.weight", "module.pretrained.layer1.0.bn1.bias", "module.pretrained.layer1.0.bn1.running_mean", "module.pretrained.layer1.0.bn1.running_var", "module.pretrained.layer1.0.bn1.num_batches_tracked", "module.pretrained.layer1.0.conv2.weight", "module.pretrained.layer1.0.bn2.weight", "module.pretrained.layer1.0.bn2.bias", "module.pretrained.layer1.0.bn2.running_mean", "module.pretrained.layer1.0.bn2.running_var", "module.pretrained.layer1.0.bn2.num_batches_tracked", "module.pretrained.layer1.0.conv3.weight", "module.pretrained.layer1.0.bn3.weight", "module.pretrained.layer1.0.bn3.bias", "module.pretrained.layer1.0.bn3.running_mean", "module.pretrained.layer1.0.bn3.running_var", "module.pretrained.layer1.0.bn3.num_batches_tracked", "module.pretrained.layer1.0.downsample.0.weight", "module.pretrained.layer1.0.downsample.1.weight", "module.pretrained.layer1.0.downsample.1.bias", "module.pretrained.layer1.0.downsample.1.running_mean", "module.pretrained.layer1.0.downsample.1.running_var", "module.pretrained.layer1.0.downsample.1.num_batches_tracked", "module.pretrained.layer1.1.conv1.weight", "module.pretrained.layer1.1.bn1.weight", "module.pretrained.layer1.1.bn1.bias", "module.pretrained.layer1.1.bn1.running_mean", "module.pretrained.layer1.1.bn1.running_var", "module.pretrained.layer1.1.bn1.num_batches_tracked", "module.pretrained.layer1.1.conv2.weight", "module.pretrained.layer1.1.bn2.weight", "module.pretrained.layer1.1.bn2.bias", "module.pretrained.layer1.1.bn2.running_mean", "module.pretrained.layer1.1.bn2.running_var", "module.pretrained.layer1.1.bn2.num_batches_tracked", "module.pretrained.layer1.1.conv3.weight", "module.pretrained.layer1.1.bn3.weight", "module.pretrained.layer1.1.bn3.bias", "module.pretrained.layer1.1.bn3.running_mean", "module.pretrained.layer1.1.bn3.running_var", "module.pretrained.layer1.1.bn3.num_batches_tracked", "module.pretrained.layer1.2.conv1.weight", "module.pretrained.layer1.2.bn1.weight", "module.pretrained.layer1.2.bn1.bias", "module.pretrained.layer1.2.bn1.running_mean", "module.pretrained.layer1.2.bn1.running_var", "module.pretrained.layer1.2.bn1.num_batches_tracked", "module.pretrained.layer1.2.conv2.weight", "module.pretrained.layer1.2.bn2.weight", "module.pretrained.layer1.2.bn2.bias", "module.pretrained.layer1.2.bn2.running_mean", "module.pretrained.layer1.2.bn2.running_var", "module.pretrained.layer1.2.bn2.num_batches_tracked", "module.pretrained.layer1.2.conv3.weight", "module.pretrained.layer1.2.bn3.weight", "module.pretrained.layer1.2.bn3.bias", "module.pretrained.layer1.2.bn3.running_mean", "module.pretrained.layer1.2.bn3.running_var", "module.pretrained.layer1.2.bn3.num_batches_tracked", "module.pretrained.layer2.0.conv1.weight", "module.pretrained.layer2.0.bn1.weight", "module.pretrained.layer2.0.bn1.bias", "module.pretrained.layer2.0.bn1.running_mean", "module.pretrained.layer2.0.bn1.running_var", "module.pretrained.layer2.0.bn1.num_batches_tracked", "module.pretrained.layer2.0.conv2.weight", "module.pretrained.layer2.0.bn2.weight", "module.pretrained.layer2.0.bn2.bias", "module.pretrained.layer2.0.bn2.running_mean", "module.pretrained.layer2.0.bn2.running_var", "module.pretrained.layer2.0.bn2.num_batches_tracked", "module.pretrained.layer2.0.conv3.weight", "module.pretrained.layer2.0.bn3.weight", "module.pretrained.layer2.0.bn3.bias", "module.pretrained.layer2.0.bn3.running_mean", "module.pretrained.layer2.0.bn3.running_var", "module.pretrained.layer2.0.bn3.num_batches_tracked", "module.pretrained.layer2.0.downsample.0.weight", "module.pretrained.layer2.0.downsample.1.weight", "module.pretrained.layer2.0.downsample.1.bias", "module.pretrained.layer2.0.downsample.1.running_mean", "module.pretrained.layer2.0.downsample.1.running_var", "module.pretrained.layer2.0.downsample.1.num_batches_tracked", "module.pretrained.layer2.1.conv1.weight", "module.pretrained.layer2.1.bn1.weight", "module.pretrained.layer2.1.bn1.bias", "module.pretrained.layer2.1.bn1.running_mean", "module.pretrained.layer2.1.bn1.running_var", "module.pretrained.layer2.1.bn1.num_batches_tracked", "module.pretrained.layer2.1.conv2.weight", "module.pretrained.layer2.1.bn2.weight", "module.pretrained.layer2.1.bn2.bias", "module.pretrained.layer2.1.bn2.running_mean", "module.pretrained.layer2.1.bn2.running_var", "module.pretrained.layer2.1.bn2.num_batches_tracked", "module.pretrained.layer2.1.conv3.weight", "module.pretrained.layer2.1.bn3.weight", "module.pretrained.layer2.1.bn3.bias", "module.pretrained.layer2.1.bn3.running_mean", "module.pretrained.layer2.1.bn3.running_var", "module.pretrained.layer2.1.bn3.num_batches_tracked", "module.pretrained.layer2.2.conv1.weight", "module.pretrained.layer2.2.bn1.weight", "module.pretrained.layer2.2.bn1.bias", "module.pretrained.layer2.2.bn1.running_mean", "module.pretrained.layer2.2.bn1.running_var", "module.pretrained.layer2.2.bn1.num_batches_tracked", "module.pretrained.layer2.2.conv2.weight", "module.pretrained.layer2.2.bn2.weight", "module.pretrained.layer2.2.bn2.bias", "module.pretrained.layer2.2.bn2.running_mean", "module.pretrained.layer2.2.bn2.running_var", "module.pretrained.layer2.2.bn2.num_batches_tracked", "module.pretrained.layer2.2.conv3.weight", "module.pretrained.layer2.2.bn3.weight", "module.pretrained.layer2.2.bn3.bias", "module.pretrained.layer2.2.bn3.running_mean", "module.pretrained.layer2.2.bn3.running_var", "module.pretrained.layer2.2.bn3.num_batches_tracked", "module.pretrained.layer2.3.conv1.weight", "module.pretrained.layer2.3.bn1.weight", "module.pretrained.layer2.3.bn1.bias", "module.pretrained.layer2.3.bn1.running_mean", "module.pretrained.layer2.3.bn1.running_var", "module.pretrained.layer2.3.bn1.num_batches_tracked", "module.pretrained.layer2.3.conv2.weight", "module.pretrained.layer2.3.bn2.weight", "module.pretrained.layer2.3.bn2.bias", "module.pretrained.layer2.3.bn2.running_mean", "module.pretrained.layer2.3.bn2.running_var", "module.pretrained.layer2.3.bn2.num_batches_tracked", "module.pretrained.layer2.3.conv3.weight", "module.pretrained.layer2.3.bn3.weight", "module.pretrained.layer2.3.bn3.bias", "module.pretrained.layer2.3.bn3.running_mean", "module.pretrained.layer2.3.bn3.running_var", "module.pretrained.layer2.3.bn3.num_batches_tracked", "module.pretrained.layer3.0.conv1.weight", "module.pretrained.layer3.0.bn1.weight", "module.pretrained.layer3.0.bn1.bias", "module.pretrained.layer3.0.bn1.running_mean", "module.pretrained.layer3.0.bn1.running_var", "module.pretrained.layer3.0.bn1.num_batches_tracked", "module.pretrained.layer3.0.conv2.weight", "module.pretrained.layer3.0.bn2.weight", "module.pretrained.layer3.0.bn2.bias", "module.pretrained.layer3.0.bn2.running_mean", "module.pretrained.layer3.0.bn2.running_var", "module.pretrained.layer3.0.bn2.num_batches_tracked", "module.pretrained.layer3.0.conv3.weight", "module.pretrained.layer3.0.bn3.weight", "module.pretrained.layer3.0.bn3.bias", "module.pretrained.layer3.0.bn3.running_mean", "module.pretrained.layer3.0.bn3.running_var", "module.pretrained.layer3.0.bn3.num_batches_tracked", "module.pretrained.layer3.0.downsample.0.weight", "module.pretrained.layer3.0.downsample.1.weight", "module.pretrained.layer3.0.downsample.1.bias", "module.pretrained.layer3.0.downsample.1.running_mean", "module.pretrained.layer3.0.downsample.1.running_var", "module.pretrained.layer3.0.downsample.1.num_batches_tracked", "module.pretrained.layer3.1.conv1.weight", "module.pretrained.layer3.1.bn1.weight", "module.pretrained.layer3.1.bn1.bias", "module.pretrained.layer3.1.bn1.running_mean", "module.pretrained.layer3.1.bn1.running_var", "module.pretrained.layer3.1.bn1.num_batches_tracked", "module.pretrained.layer3.1.conv2.weight", "module.pretrained.layer3.1.bn2.weight", "module.pretrained.layer3.1.bn2.bias", "module.pretrained.layer3.1.bn2.running_mean", "module.pretrained.layer3.1.bn2.running_var", "module.pretrained.layer3.1.bn2.num_batches_tracked", "module.pretrained.layer3.1.conv3.weight", "module.pretrained.layer3.1.bn3.weight", "module.pretrained.layer3.1.bn3.bias", "module.pretrained.layer3.1.bn3.running_mean", "module.pretrained.layer3.1.bn3.running_var", "module.pretrained.layer3.1.bn3.num_batches_tracked", "module.pretrained.layer3.2.conv1.weight", "module.pretrained.layer3.2.bn1.weight", "module.pretrained.layer3.2.bn1.bias", "module.pretrained.layer3.2.bn1.running_mean", "module.pretrained.layer3.2.bn1.running_var", "module.pretrained.layer3.2.bn1.num_batches_tracked", "module.pretrained.layer3.2.conv2.weight", "module.pretrained.layer3.2.bn2.weight", "module.pretrained.layer3.2.bn2.bias", "module.pretrained.layer3.2.bn2.running_mean", "module.pretrained.layer3.2.bn2.running_var", "module.pretrained.layer3.2.bn2.num_batches_tracked", "module.pretrained.layer3.2.conv3.weight", "module.pretrained.layer3.2.bn3.weight", "module.pretrained.layer3.2.bn3.bias", "module.pretrained.layer3.2.bn3.running_mean", "module.pretrained.layer3.2.bn3.running_var", "module.pretrained.layer3.2.bn3.num_batches_tracked", "module.pretrained.layer3.3.conv1.weight", "module.pretrained.layer3.3.bn1.weight", "module.pretrained.layer3.3.bn1.bias", "module.pretrained.layer3.3.bn1.running_mean", "module.pretrained.layer3.3.bn1.running_var", "module.pretrained.layer3.3.bn1.num_batches_tracked", "module.pretrained.layer3.3.conv2.weight", "module.pretrained.layer3.3.bn2.weight", "module.pretrained.layer3.3.bn2.bias", "module.pretrained.layer3.3.bn2.running_mean", "module.pretrained.layer3.3.bn2.running_var", "module.pretrained.layer3.3.bn2.num_batches_tracked", "module.pretrained.layer3.3.conv3.weight", "module.pretrained.layer3.3.bn3.weight", "module.pretrained.layer3.3.bn3.bias", "module.pretrained.layer3.3.bn3.running_mean", "module.pretrained.layer3.3.bn3.running_var", "module.pretrained.layer3.3.bn3.num_batches_tracked", "module.pretrained.layer3.4.conv1.weight", "module.pretrained.layer3.4.bn1.weight", "module.pretrained.layer3.4.bn1.bias", "module.pretrained.layer3.4.bn1.running_mean", "module.pretrained.layer3.4.bn1.running_var", "module.pretrained.layer3.4.bn1.num_batches_tracked", "module.pretrained.layer3.4.conv2.weight", "module.pretrained.layer3.4.bn2.weight", "module.pretrained.layer3.4.bn2.bias", "module.pretrained.layer3.4.bn2.running_mean", "module.pretrained.layer3.4.bn2.running_var", "module.pretrained.layer3.4.bn2.num_batches_tracked", "module.pretrained.layer3.4.conv3.weight", "module.pretrained.layer3.4.bn3.weight", "module.pretrained.layer3.4.bn3.bias", "module.pretrained.layer3.4.bn3.running_mean", "module.pretrained.layer3.4.bn3.running_var", "module.pretrained.layer3.4.bn3.num_batches_tracked", "module.pretrained.layer3.5.conv1.weight", "module.pretrained.layer3.5.bn1.weight", "module.pretrained.layer3.5.bn1.bias", "module.pretrained.layer3.5.bn1.running_mean", "module.pretrained.layer3.5.bn1.running_var", "module.pretrained.layer3.5.bn1.num_batches_tracked", "module.pretrained.layer3.5.conv2.weight", "module.pretrained.layer3.5.bn2.weight", "module.pretrained.layer3.5.bn2.bias", "module.pretrained.layer3.5.bn2.running_mean", "module.pretrained.layer3.5.bn2.running_var", "module.pretrained.layer3.5.bn2.num_batches_tracked", "module.pretrained.layer3.5.conv3.weight", "module.pretrained.layer3.5.bn3.weight", "module.pretrained.layer3.5.bn3.bias", "module.pretrained.layer3.5.bn3.running_mean", "module.pretrained.layer3.5.bn3.running_var", "module.pretrained.layer3.5.bn3.num_batches_tracked", "module.pretrained.layer4.0.conv1.weight", "module.pretrained.layer4.0.bn1.weight", "module.pretrained.layer4.0.bn1.bias", "module.pretrained.layer4.0.bn1.running_mean", "module.pretrained.layer4.0.bn1.running_var", "module.pretrained.layer4.0.bn1.num_batches_tracked", "module.pretrained.layer4.0.conv2.weight", "module.pretrained.layer4.0.bn2.weight", "module.pretrained.layer4.0.bn2.bias", "module.pretrained.layer4.0.bn2.running_mean", "module.pretrained.layer4.0.bn2.running_var", "module.pretrained.layer4.0.bn2.num_batches_tracked", "module.pretrained.layer4.0.conv3.weight", "module.pretrained.layer4.0.bn3.weight", "module.pretrained.layer4.0.bn3.bias", "module.pretrained.layer4.0.bn3.running_mean", "module.pretrained.layer4.0.bn3.running_var", "module.pretrained.layer4.0.bn3.num_batches_tracked", "module.pretrained.layer4.0.downsample.0.weight", "module.pretrained.layer4.0.downsample.1.weight", "module.pretrained.layer4.0.downsample.1.bias", "module.pretrained.layer4.0.downsample.1.running_mean", "module.pretrained.layer4.0.downsample.1.running_var", "module.pretrained.layer4.0.downsample.1.num_batches_tracked", "module.pretrained.layer4.1.conv1.weight", "module.pretrained.layer4.1.bn1.weight", "module.pretrained.layer4.1.bn1.bias", "module.pretrained.layer4.1.bn1.running_mean", "module.pretrained.layer4.1.bn1.running_var", "module.pretrained.layer4.1.bn1.num_batches_tracked", "module.pretrained.layer4.1.conv2.weight", "module.pretrained.layer4.1.bn2.weight", "module.pretrained.layer4.1.bn2.bias", "module.pretrained.layer4.1.bn2.running_mean", "module.pretrained.layer4.1.bn2.running_var", "module.pretrained.layer4.1.bn2.num_batches_tracked", "module.pretrained.layer4.1.conv3.weight", "module.pretrained.layer4.1.bn3.weight", "module.pretrained.layer4.1.bn3.bias", "module.pretrained.layer4.1.bn3.running_mean", "module.pretrained.layer4.1.bn3.running_var", "module.pretrained.layer4.1.bn3.num_batches_tracked", "module.pretrained.layer4.2.conv1.weight", "module.pretrained.layer4.2.bn1.weight", "module.pretrained.layer4.2.bn1.bias", "module.pretrained.layer4.2.bn1.running_mean", "module.pretrained.layer4.2.bn1.running_var", "module.pretrained.layer4.2.bn1.num_batches_tracked", "module.pretrained.layer4.2.conv2.weight", "module.pretrained.layer4.2.bn2.weight", "module.pretrained.layer4.2.bn2.bias", "module.pretrained.layer4.2.bn2.running_mean", "module.pretrained.layer4.2.bn2.running_var", "module.pretrained.layer4.2.bn2.num_batches_tracked", "module.pretrained.layer4.2.conv3.weight", "module.pretrained.layer4.2.bn3.weight", "module.pretrained.layer4.2.bn3.bias", "module.pretrained.layer4.2.bn3.running_mean", "module.pretrained.layer4.2.bn3.running_var", "module.pretrained.layer4.2.bn3.num_batches_tracked", "module.pretrained.fc.weight", "module.pretrained.fc.bias", "module.head.0.weight", "module.head.0.bias", "module.head.1.weight", "module.head.1.bias", "module.head.1.running_mean", "module.head.1.running_var", "module.head.1.num_batches_tracked", "module.head.3.codewords", "module.head.3.scale", "module.head.6.weight", "module.head.6.bias".

I have successfully done the prior instructions but I don't know why I missed these keys and had those unexpected keys. It seems like something got messed up in deepten_minc.pth. Could you help me solve this problems? Thanks! my_env: pytorch 0.4.1, anaconda3, python 3.6, macOS

Xiuyu-Li commented 6 years ago

I found that there is a module. added to the missing keys, which makes all required keys become the "unexpected keys," but I don't know why this happened.

zhanghang1989 commented 6 years ago

Hi, could you update the PyTorch to newer version?

Xiuyu-Li commented 6 years ago

Isn't PyTorch 0.4.1 the newest version?

zhanghang1989 commented 6 years ago

Please install the master branch from GitHub or you could wait a little bit for next stable release.

Xiuyu-Li commented 6 years ago

After I updated torch to version '0.5.0a0+fa9ea5b,' I still got the same error message. Is it because I change checkpoint = torch.load(args.resume) in main.py, line 67 to checkpoint = torch.load(args.resume, map_location='cpu')?

zhanghang1989 commented 6 years ago

are you using cpu machine? I haven't tested my code without gpu

Xiuyu-Li commented 6 years ago

Yes, I am using my Mac's cpu. I will test the code in my server's gpu later to find out whether this is the case.

pratyushmaini commented 5 years ago

Adding model = nn.DataParallel(model) before loading should fix it

Ketki-Savle commented 4 years ago

Adding model = nn.DataParallel(model) is not helping in my case.

KanchanIIT commented 4 years ago

you can use strict=False in load_state_dict. This can solved the issue.

model.load_state_dict(checkpoint['state_dict'], strict=False)
PhilipMay commented 4 years ago

you can use strict=False in load_state_dict. This can solved the issue.

model.load_state_dict(checkpoint['state_dict'], strict=False)

Well - does it solve the issue or just hide it?

harshpaal commented 4 years ago

Adding model = nn.DataParallel(model) before loading should fix it

It helped bro, thanku very much

ZhongxuanWang commented 4 years ago

I finally solved the problem, in my case neither of the solutions above helped, though

you can use strict=False in load_state_dict. This can solved the issue.

model.load_state_dict(checkpoint['state_dict'], strict=False)

this hid the error. My case was the model I loaded used a different architecture than the model architecture name I passed in while initializing using models.MainModel. So be careful about model you are using.

sundongwei commented 3 years ago

Hi Mr. Zhang: When I test pre-trained model on MINC-2500 using: python main.py --dataset minc --model deepten --nclass 23 --resume deepten_minc.pth --eval, I got the following errors:

=> loading checkpoint 'deepten_minc.pth'
Traceback (most recent call last):
  File "main.py", line 174, in <module>
    main()
  File "main.py", line 72, in main
    model.load_state_dict(checkpoint['state_dict'])
  File "/Users/pro/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 719, in load_state_dict
    self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for Net:
  Missing key(s) in state_dict: "pretrained.conv1.weight", "pretrained.bn1.weight", "pretrained.bn1.bias", "pretrained.bn1.running_mean", "pretrained.bn1.running_var", "pretrained.layer1.0.conv1.weight", "pretrained.layer1.0.bn1.weight", "pretrained.layer1.0.bn1.bias", "pretrained.layer1.0.bn1.running_mean", "pretrained.layer1.0.bn1.running_var", "pretrained.layer1.0.conv2.weight", "pretrained.layer1.0.bn2.weight", "pretrained.layer1.0.bn2.bias", "pretrained.layer1.0.bn2.running_mean", "pretrained.layer1.0.bn2.running_var", "pretrained.layer1.0.conv3.weight", "pretrained.layer1.0.bn3.weight", "pretrained.layer1.0.bn3.bias", "pretrained.layer1.0.bn3.running_mean", "pretrained.layer1.0.bn3.running_var", "pretrained.layer1.0.downsample.0.weight", "pretrained.layer1.0.downsample.1.weight", "pretrained.layer1.0.downsample.1.bias", "pretrained.layer1.0.downsample.1.running_mean", "pretrained.layer1.0.downsample.1.running_var", "pretrained.layer1.1.conv1.weight", "pretrained.layer1.1.bn1.weight", "pretrained.layer1.1.bn1.bias", "pretrained.layer1.1.bn1.running_mean", "pretrained.layer1.1.bn1.running_var", "pretrained.layer1.1.conv2.weight", "pretrained.layer1.1.bn2.weight", "pretrained.layer1.1.bn2.bias", "pretrained.layer1.1.bn2.running_mean", "pretrained.layer1.1.bn2.running_var", "pretrained.layer1.1.conv3.weight", "pretrained.layer1.1.bn3.weight", "pretrained.layer1.1.bn3.bias", "pretrained.layer1.1.bn3.running_mean", "pretrained.layer1.1.bn3.running_var", "pretrained.layer1.2.conv1.weight", "pretrained.layer1.2.bn1.weight", "pretrained.layer1.2.bn1.bias", "pretrained.layer1.2.bn1.running_mean", "pretrained.layer1.2.bn1.running_var", "pretrained.layer1.2.conv2.weight", "pretrained.layer1.2.bn2.weight", "pretrained.layer1.2.bn2.bias", "pretrained.layer1.2.bn2.running_mean", "pretrained.layer1.2.bn2.running_var", "pretrained.layer1.2.conv3.weight", "pretrained.layer1.2.bn3.weight", "pretrained.layer1.2.bn3.bias", "pretrained.layer1.2.bn3.running_mean", "pretrained.layer1.2.bn3.running_var", "pretrained.layer2.0.conv1.weight", "pretrained.layer2.0.bn1.weight", "pretrained.layer2.0.bn1.bias", "pretrained.layer2.0.bn1.running_mean", "pretrained.layer2.0.bn1.running_var", "pretrained.layer2.0.conv2.weight", "pretrained.layer2.0.bn2.weight", "pretrained.layer2.0.bn2.bias", "pretrained.layer2.0.bn2.running_mean", "pretrained.layer2.0.bn2.running_var", "pretrained.layer2.0.conv3.weight", "pretrained.layer2.0.bn3.weight", "pretrained.layer2.0.bn3.bias", "pretrained.layer2.0.bn3.running_mean", "pretrained.layer2.0.bn3.running_var", "pretrained.layer2.0.downsample.0.weight", "pretrained.layer2.0.downsample.1.weight", "pretrained.layer2.0.downsample.1.bias", "pretrained.layer2.0.downsample.1.running_mean", "pretrained.layer2.0.downsample.1.running_var", "pretrained.layer2.1.conv1.weight", "pretrained.layer2.1.bn1.weight", "pretrained.layer2.1.bn1.bias", "pretrained.layer2.1.bn1.running_mean", "pretrained.layer2.1.bn1.running_var", "pretrained.layer2.1.conv2.weight", "pretrained.layer2.1.bn2.weight", "pretrained.layer2.1.bn2.bias", "pretrained.layer2.1.bn2.running_mean", "pretrained.layer2.1.bn2.running_var", "pretrained.layer2.1.conv3.weight", "pretrained.layer2.1.bn3.weight", "pretrained.layer2.1.bn3.bias", "pretrained.layer2.1.bn3.running_mean", "pretrained.layer2.1.bn3.running_var", "pretrained.layer2.2.conv1.weight", "pretrained.layer2.2.bn1.weight", "pretrained.layer2.2.bn1.bias", "pretrained.layer2.2.bn1.running_mean", "pretrained.layer2.2.bn1.running_var", "pretrained.layer2.2.conv2.weight", "pretrained.layer2.2.bn2.weight", "pretrained.layer2.2.bn2.bias", "pretrained.layer2.2.bn2.running_mean", "pretrained.layer2.2.bn2.running_var", "pretrained.layer2.2.conv3.weight", "pretrained.layer2.2.bn3.weight", "pretrained.layer2.2.bn3.bias", "pretrained.layer2.2.bn3.running_mean", "pretrained.layer2.2.bn3.running_var", "pretrained.layer2.3.conv1.weight", "pretrained.layer2.3.bn1.weight", "pretrained.layer2.3.bn1.bias", "pretrained.layer2.3.bn1.running_mean", "pretrained.layer2.3.bn1.running_var", "pretrained.layer2.3.conv2.weight", "pretrained.layer2.3.bn2.weight", "pretrained.layer2.3.bn2.bias", "pretrained.layer2.3.bn2.running_mean", "pretrained.layer2.3.bn2.running_var", "pretrained.layer2.3.conv3.weight", "pretrained.layer2.3.bn3.weight", "pretrained.layer2.3.bn3.bias", "pretrained.layer2.3.bn3.running_mean", "pretrained.layer2.3.bn3.running_var", "pretrained.layer3.0.conv1.weight", "pretrained.layer3.0.bn1.weight", "pretrained.layer3.0.bn1.bias", "pretrained.layer3.0.bn1.running_mean", "pretrained.layer3.0.bn1.running_var", "pretrained.layer3.0.conv2.weight", "pretrained.layer3.0.bn2.weight", "pretrained.layer3.0.bn2.bias", "pretrained.layer3.0.bn2.running_mean", "pretrained.layer3.0.bn2.running_var", "pretrained.layer3.0.conv3.weight", "pretrained.layer3.0.bn3.weight", "pretrained.layer3.0.bn3.bias", "pretrained.layer3.0.bn3.running_mean", "pretrained.layer3.0.bn3.running_var", "pretrained.layer3.0.downsample.0.weight", "pretrained.layer3.0.downsample.1.weight", "pretrained.layer3.0.downsample.1.bias", "pretrained.layer3.0.downsample.1.running_mean", "pretrained.layer3.0.downsample.1.running_var", "pretrained.layer3.1.conv1.weight", "pretrained.layer3.1.bn1.weight", "pretrained.layer3.1.bn1.bias", "pretrained.layer3.1.bn1.running_mean", "pretrained.layer3.1.bn1.running_var", "pretrained.layer3.1.conv2.weight", "pretrained.layer3.1.bn2.weight", "pretrained.layer3.1.bn2.bias", "pretrained.layer3.1.bn2.running_mean", "pretrained.layer3.1.bn2.running_var", "pretrained.layer3.1.conv3.weight", "pretrained.layer3.1.bn3.weight", "pretrained.layer3.1.bn3.bias", "pretrained.layer3.1.bn3.running_mean", "pretrained.layer3.1.bn3.running_var", "pretrained.layer3.2.conv1.weight", "pretrained.layer3.2.bn1.weight", "pretrained.layer3.2.bn1.bias", "pretrained.layer3.2.bn1.running_mean", "pretrained.layer3.2.bn1.running_var", "pretrained.layer3.2.conv2.weight", "pretrained.layer3.2.bn2.weight", "pretrained.layer3.2.bn2.bias", "pretrained.layer3.2.bn2.running_mean", "pretrained.layer3.2.bn2.running_var", "pretrained.layer3.2.conv3.weight", "pretrained.layer3.2.bn3.weight", "pretrained.layer3.2.bn3.bias", "pretrained.layer3.2.bn3.running_mean", "pretrained.layer3.2.bn3.running_var", "pretrained.layer3.3.conv1.weight", "pretrained.layer3.3.bn1.weight", "pretrained.layer3.3.bn1.bias", "pretrained.layer3.3.bn1.running_mean", "pretrained.layer3.3.bn1.running_var", "pretrained.layer3.3.conv2.weight", "pretrained.layer3.3.bn2.weight", "pretrained.layer3.3.bn2.bias", "pretrained.layer3.3.bn2.running_mean", "pretrained.layer3.3.bn2.running_var", "pretrained.layer3.3.conv3.weight", "pretrained.layer3.3.bn3.weight", "pretrained.layer3.3.bn3.bias", "pretrained.layer3.3.bn3.running_mean", "pretrained.layer3.3.bn3.running_var", "pretrained.layer3.4.conv1.weight", "pretrained.layer3.4.bn1.weight", "pretrained.layer3.4.bn1.bias", "pretrained.layer3.4.bn1.running_mean", "pretrained.layer3.4.bn1.running_var", "pretrained.layer3.4.conv2.weight", "pretrained.layer3.4.bn2.weight", "pretrained.layer3.4.bn2.bias", "pretrained.layer3.4.bn2.running_mean", "pretrained.layer3.4.bn2.running_var", "pretrained.layer3.4.conv3.weight", "pretrained.layer3.4.bn3.weight", "pretrained.layer3.4.bn3.bias", "pretrained.layer3.4.bn3.running_mean", "pretrained.layer3.4.bn3.running_var", "pretrained.layer3.5.conv1.weight", "pretrained.layer3.5.bn1.weight", "pretrained.layer3.5.bn1.bias", "pretrained.layer3.5.bn1.running_mean", "pretrained.layer3.5.bn1.running_var", "pretrained.layer3.5.conv2.weight", "pretrained.layer3.5.bn2.weight", "pretrained.layer3.5.bn2.bias", "pretrained.layer3.5.bn2.running_mean", "pretrained.layer3.5.bn2.running_var", "pretrained.layer3.5.conv3.weight", "pretrained.layer3.5.bn3.weight", "pretrained.layer3.5.bn3.bias", "pretrained.layer3.5.bn3.running_mean", "pretrained.layer3.5.bn3.running_var", "pretrained.layer4.0.conv1.weight", "pretrained.layer4.0.bn1.weight", "pretrained.layer4.0.bn1.bias", "pretrained.layer4.0.bn1.running_mean", "pretrained.layer4.0.bn1.running_var", "pretrained.layer4.0.conv2.weight", "pretrained.layer4.0.bn2.weight", "pretrained.layer4.0.bn2.bias", "pretrained.layer4.0.bn2.running_mean", "pretrained.layer4.0.bn2.running_var", "pretrained.layer4.0.conv3.weight", "pretrained.layer4.0.bn3.weight", "pretrained.layer4.0.bn3.bias", "pretrained.layer4.0.bn3.running_mean", "pretrained.layer4.0.bn3.running_var", "pretrained.layer4.0.downsample.0.weight", "pretrained.layer4.0.downsample.1.weight", "pretrained.layer4.0.downsample.1.bias", "pretrained.layer4.0.downsample.1.running_mean", "pretrained.layer4.0.downsample.1.running_var", "pretrained.layer4.1.conv1.weight", "pretrained.layer4.1.bn1.weight", "pretrained.layer4.1.bn1.bias", "pretrained.layer4.1.bn1.running_mean", "pretrained.layer4.1.bn1.running_var", "pretrained.layer4.1.conv2.weight", "pretrained.layer4.1.bn2.weight", "pretrained.layer4.1.bn2.bias", "pretrained.layer4.1.bn2.running_mean", "pretrained.layer4.1.bn2.running_var", "pretrained.layer4.1.conv3.weight", "pretrained.layer4.1.bn3.weight", "pretrained.layer4.1.bn3.bias", "pretrained.layer4.1.bn3.running_mean", "pretrained.layer4.1.bn3.running_var", "pretrained.layer4.2.conv1.weight", "pretrained.layer4.2.bn1.weight", "pretrained.layer4.2.bn1.bias", "pretrained.layer4.2.bn1.running_mean", "pretrained.layer4.2.bn1.running_var", "pretrained.layer4.2.conv2.weight", "pretrained.layer4.2.bn2.weight", "pretrained.layer4.2.bn2.bias", "pretrained.layer4.2.bn2.running_mean", "pretrained.layer4.2.bn2.running_var", "pretrained.layer4.2.conv3.weight", "pretrained.layer4.2.bn3.weight", "pretrained.layer4.2.bn3.bias", "pretrained.layer4.2.bn3.running_mean", "pretrained.layer4.2.bn3.running_var", "pretrained.fc.weight", "pretrained.fc.bias", "head.0.weight", "head.0.bias", "head.1.weight", "head.1.bias", "head.1.running_mean", "head.1.running_var", "head.3.codewords", "head.3.scale", "head.6.weight", "head.6.bias".
  Unexpected key(s) in state_dict: "module.pretrained.conv1.weight", "module.pretrained.bn1.weight", "module.pretrained.bn1.bias", "module.pretrained.bn1.running_mean", "module.pretrained.bn1.running_var", "module.pretrained.bn1.num_batches_tracked", "module.pretrained.layer1.0.conv1.weight", "module.pretrained.layer1.0.bn1.weight", "module.pretrained.layer1.0.bn1.bias", "module.pretrained.layer1.0.bn1.running_mean", "module.pretrained.layer1.0.bn1.running_var", "module.pretrained.layer1.0.bn1.num_batches_tracked", "module.pretrained.layer1.0.conv2.weight", "module.pretrained.layer1.0.bn2.weight", "module.pretrained.layer1.0.bn2.bias", "module.pretrained.layer1.0.bn2.running_mean", "module.pretrained.layer1.0.bn2.running_var", "module.pretrained.layer1.0.bn2.num_batches_tracked", "module.pretrained.layer1.0.conv3.weight", "module.pretrained.layer1.0.bn3.weight", "module.pretrained.layer1.0.bn3.bias", "module.pretrained.layer1.0.bn3.running_mean", "module.pretrained.layer1.0.bn3.running_var", "module.pretrained.layer1.0.bn3.num_batches_tracked", "module.pretrained.layer1.0.downsample.0.weight", "module.pretrained.layer1.0.downsample.1.weight", "module.pretrained.layer1.0.downsample.1.bias", "module.pretrained.layer1.0.downsample.1.running_mean", "module.pretrained.layer1.0.downsample.1.running_var", "module.pretrained.layer1.0.downsample.1.num_batches_tracked", "module.pretrained.layer1.1.conv1.weight", "module.pretrained.layer1.1.bn1.weight", "module.pretrained.layer1.1.bn1.bias", "module.pretrained.layer1.1.bn1.running_mean", "module.pretrained.layer1.1.bn1.running_var", "module.pretrained.layer1.1.bn1.num_batches_tracked", "module.pretrained.layer1.1.conv2.weight", "module.pretrained.layer1.1.bn2.weight", "module.pretrained.layer1.1.bn2.bias", "module.pretrained.layer1.1.bn2.running_mean", "module.pretrained.layer1.1.bn2.running_var", "module.pretrained.layer1.1.bn2.num_batches_tracked", "module.pretrained.layer1.1.conv3.weight", "module.pretrained.layer1.1.bn3.weight", "module.pretrained.layer1.1.bn3.bias", "module.pretrained.layer1.1.bn3.running_mean", "module.pretrained.layer1.1.bn3.running_var", "module.pretrained.layer1.1.bn3.num_batches_tracked", "module.pretrained.layer1.2.conv1.weight", "module.pretrained.layer1.2.bn1.weight", "module.pretrained.layer1.2.bn1.bias", "module.pretrained.layer1.2.bn1.running_mean", "module.pretrained.layer1.2.bn1.running_var", "module.pretrained.layer1.2.bn1.num_batches_tracked", "module.pretrained.layer1.2.conv2.weight", "module.pretrained.layer1.2.bn2.weight", "module.pretrained.layer1.2.bn2.bias", "module.pretrained.layer1.2.bn2.running_mean", "module.pretrained.layer1.2.bn2.running_var", "module.pretrained.layer1.2.bn2.num_batches_tracked", "module.pretrained.layer1.2.conv3.weight", "module.pretrained.layer1.2.bn3.weight", "module.pretrained.layer1.2.bn3.bias", "module.pretrained.layer1.2.bn3.running_mean", "module.pretrained.layer1.2.bn3.running_var", "module.pretrained.layer1.2.bn3.num_batches_tracked", "module.pretrained.layer2.0.conv1.weight", "module.pretrained.layer2.0.bn1.weight", "module.pretrained.layer2.0.bn1.bias", "module.pretrained.layer2.0.bn1.running_mean", "module.pretrained.layer2.0.bn1.running_var", "module.pretrained.layer2.0.bn1.num_batches_tracked", "module.pretrained.layer2.0.conv2.weight", "module.pretrained.layer2.0.bn2.weight", "module.pretrained.layer2.0.bn2.bias", "module.pretrained.layer2.0.bn2.running_mean", "module.pretrained.layer2.0.bn2.running_var", "module.pretrained.layer2.0.bn2.num_batches_tracked", "module.pretrained.layer2.0.conv3.weight", "module.pretrained.layer2.0.bn3.weight", "module.pretrained.layer2.0.bn3.bias", "module.pretrained.layer2.0.bn3.running_mean", "module.pretrained.layer2.0.bn3.running_var", "module.pretrained.layer2.0.bn3.num_batches_tracked", "module.pretrained.layer2.0.downsample.0.weight", "module.pretrained.layer2.0.downsample.1.weight", "module.pretrained.layer2.0.downsample.1.bias", "module.pretrained.layer2.0.downsample.1.running_mean", "module.pretrained.layer2.0.downsample.1.running_var", "module.pretrained.layer2.0.downsample.1.num_batches_tracked", "module.pretrained.layer2.1.conv1.weight", "module.pretrained.layer2.1.bn1.weight", "module.pretrained.layer2.1.bn1.bias", "module.pretrained.layer2.1.bn1.running_mean", "module.pretrained.layer2.1.bn1.running_var", "module.pretrained.layer2.1.bn1.num_batches_tracked", "module.pretrained.layer2.1.conv2.weight", "module.pretrained.layer2.1.bn2.weight", "module.pretrained.layer2.1.bn2.bias", "module.pretrained.layer2.1.bn2.running_mean", "module.pretrained.layer2.1.bn2.running_var", "module.pretrained.layer2.1.bn2.num_batches_tracked", "module.pretrained.layer2.1.conv3.weight", "module.pretrained.layer2.1.bn3.weight", "module.pretrained.layer2.1.bn3.bias", "module.pretrained.layer2.1.bn3.running_mean", "module.pretrained.layer2.1.bn3.running_var", "module.pretrained.layer2.1.bn3.num_batches_tracked", "module.pretrained.layer2.2.conv1.weight", "module.pretrained.layer2.2.bn1.weight", "module.pretrained.layer2.2.bn1.bias", "module.pretrained.layer2.2.bn1.running_mean", "module.pretrained.layer2.2.bn1.running_var", "module.pretrained.layer2.2.bn1.num_batches_tracked", "module.pretrained.layer2.2.conv2.weight", "module.pretrained.layer2.2.bn2.weight", "module.pretrained.layer2.2.bn2.bias", "module.pretrained.layer2.2.bn2.running_mean", "module.pretrained.layer2.2.bn2.running_var", "module.pretrained.layer2.2.bn2.num_batches_tracked", "module.pretrained.layer2.2.conv3.weight", "module.pretrained.layer2.2.bn3.weight", "module.pretrained.layer2.2.bn3.bias", "module.pretrained.layer2.2.bn3.running_mean", "module.pretrained.layer2.2.bn3.running_var", "module.pretrained.layer2.2.bn3.num_batches_tracked", "module.pretrained.layer2.3.conv1.weight", "module.pretrained.layer2.3.bn1.weight", "module.pretrained.layer2.3.bn1.bias", "module.pretrained.layer2.3.bn1.running_mean", "module.pretrained.layer2.3.bn1.running_var", "module.pretrained.layer2.3.bn1.num_batches_tracked", "module.pretrained.layer2.3.conv2.weight", "module.pretrained.layer2.3.bn2.weight", "module.pretrained.layer2.3.bn2.bias", "module.pretrained.layer2.3.bn2.running_mean", "module.pretrained.layer2.3.bn2.running_var", "module.pretrained.layer2.3.bn2.num_batches_tracked", "module.pretrained.layer2.3.conv3.weight", "module.pretrained.layer2.3.bn3.weight", "module.pretrained.layer2.3.bn3.bias", "module.pretrained.layer2.3.bn3.running_mean", "module.pretrained.layer2.3.bn3.running_var", "module.pretrained.layer2.3.bn3.num_batches_tracked", "module.pretrained.layer3.0.conv1.weight", "module.pretrained.layer3.0.bn1.weight", "module.pretrained.layer3.0.bn1.bias", "module.pretrained.layer3.0.bn1.running_mean", "module.pretrained.layer3.0.bn1.running_var", "module.pretrained.layer3.0.bn1.num_batches_tracked", "module.pretrained.layer3.0.conv2.weight", "module.pretrained.layer3.0.bn2.weight", "module.pretrained.layer3.0.bn2.bias", "module.pretrained.layer3.0.bn2.running_mean", "module.pretrained.layer3.0.bn2.running_var", "module.pretrained.layer3.0.bn2.num_batches_tracked", "module.pretrained.layer3.0.conv3.weight", "module.pretrained.layer3.0.bn3.weight", "module.pretrained.layer3.0.bn3.bias", "module.pretrained.layer3.0.bn3.running_mean", "module.pretrained.layer3.0.bn3.running_var", "module.pretrained.layer3.0.bn3.num_batches_tracked", "module.pretrained.layer3.0.downsample.0.weight", "module.pretrained.layer3.0.downsample.1.weight", "module.pretrained.layer3.0.downsample.1.bias", "module.pretrained.layer3.0.downsample.1.running_mean", "module.pretrained.layer3.0.downsample.1.running_var", "module.pretrained.layer3.0.downsample.1.num_batches_tracked", "module.pretrained.layer3.1.conv1.weight", "module.pretrained.layer3.1.bn1.weight", "module.pretrained.layer3.1.bn1.bias", "module.pretrained.layer3.1.bn1.running_mean", "module.pretrained.layer3.1.bn1.running_var", "module.pretrained.layer3.1.bn1.num_batches_tracked", "module.pretrained.layer3.1.conv2.weight", "module.pretrained.layer3.1.bn2.weight", "module.pretrained.layer3.1.bn2.bias", "module.pretrained.layer3.1.bn2.running_mean", "module.pretrained.layer3.1.bn2.running_var", "module.pretrained.layer3.1.bn2.num_batches_tracked", "module.pretrained.layer3.1.conv3.weight", "module.pretrained.layer3.1.bn3.weight", "module.pretrained.layer3.1.bn3.bias", "module.pretrained.layer3.1.bn3.running_mean", "module.pretrained.layer3.1.bn3.running_var", "module.pretrained.layer3.1.bn3.num_batches_tracked", "module.pretrained.layer3.2.conv1.weight", "module.pretrained.layer3.2.bn1.weight", "module.pretrained.layer3.2.bn1.bias", "module.pretrained.layer3.2.bn1.running_mean", "module.pretrained.layer3.2.bn1.running_var", "module.pretrained.layer3.2.bn1.num_batches_tracked", "module.pretrained.layer3.2.conv2.weight", "module.pretrained.layer3.2.bn2.weight", "module.pretrained.layer3.2.bn2.bias", "module.pretrained.layer3.2.bn2.running_mean", "module.pretrained.layer3.2.bn2.running_var", "module.pretrained.layer3.2.bn2.num_batches_tracked", "module.pretrained.layer3.2.conv3.weight", "module.pretrained.layer3.2.bn3.weight", "module.pretrained.layer3.2.bn3.bias", "module.pretrained.layer3.2.bn3.running_mean", "module.pretrained.layer3.2.bn3.running_var", "module.pretrained.layer3.2.bn3.num_batches_tracked", "module.pretrained.layer3.3.conv1.weight", "module.pretrained.layer3.3.bn1.weight", "module.pretrained.layer3.3.bn1.bias", "module.pretrained.layer3.3.bn1.running_mean", "module.pretrained.layer3.3.bn1.running_var", "module.pretrained.layer3.3.bn1.num_batches_tracked", "module.pretrained.layer3.3.conv2.weight", "module.pretrained.layer3.3.bn2.weight", "module.pretrained.layer3.3.bn2.bias", "module.pretrained.layer3.3.bn2.running_mean", "module.pretrained.layer3.3.bn2.running_var", "module.pretrained.layer3.3.bn2.num_batches_tracked", "module.pretrained.layer3.3.conv3.weight", "module.pretrained.layer3.3.bn3.weight", "module.pretrained.layer3.3.bn3.bias", "module.pretrained.layer3.3.bn3.running_mean", "module.pretrained.layer3.3.bn3.running_var", "module.pretrained.layer3.3.bn3.num_batches_tracked", "module.pretrained.layer3.4.conv1.weight", "module.pretrained.layer3.4.bn1.weight", "module.pretrained.layer3.4.bn1.bias", "module.pretrained.layer3.4.bn1.running_mean", "module.pretrained.layer3.4.bn1.running_var", "module.pretrained.layer3.4.bn1.num_batches_tracked", "module.pretrained.layer3.4.conv2.weight", "module.pretrained.layer3.4.bn2.weight", "module.pretrained.layer3.4.bn2.bias", "module.pretrained.layer3.4.bn2.running_mean", "module.pretrained.layer3.4.bn2.running_var", "module.pretrained.layer3.4.bn2.num_batches_tracked", "module.pretrained.layer3.4.conv3.weight", "module.pretrained.layer3.4.bn3.weight", "module.pretrained.layer3.4.bn3.bias", "module.pretrained.layer3.4.bn3.running_mean", "module.pretrained.layer3.4.bn3.running_var", "module.pretrained.layer3.4.bn3.num_batches_tracked", "module.pretrained.layer3.5.conv1.weight", "module.pretrained.layer3.5.bn1.weight", "module.pretrained.layer3.5.bn1.bias", "module.pretrained.layer3.5.bn1.running_mean", "module.pretrained.layer3.5.bn1.running_var", "module.pretrained.layer3.5.bn1.num_batches_tracked", "module.pretrained.layer3.5.conv2.weight", "module.pretrained.layer3.5.bn2.weight", "module.pretrained.layer3.5.bn2.bias", "module.pretrained.layer3.5.bn2.running_mean", "module.pretrained.layer3.5.bn2.running_var", "module.pretrained.layer3.5.bn2.num_batches_tracked", "module.pretrained.layer3.5.conv3.weight", "module.pretrained.layer3.5.bn3.weight", "module.pretrained.layer3.5.bn3.bias", "module.pretrained.layer3.5.bn3.running_mean", "module.pretrained.layer3.5.bn3.running_var", "module.pretrained.layer3.5.bn3.num_batches_tracked", "module.pretrained.layer4.0.conv1.weight", "module.pretrained.layer4.0.bn1.weight", "module.pretrained.layer4.0.bn1.bias", "module.pretrained.layer4.0.bn1.running_mean", "module.pretrained.layer4.0.bn1.running_var", "module.pretrained.layer4.0.bn1.num_batches_tracked", "module.pretrained.layer4.0.conv2.weight", "module.pretrained.layer4.0.bn2.weight", "module.pretrained.layer4.0.bn2.bias", "module.pretrained.layer4.0.bn2.running_mean", "module.pretrained.layer4.0.bn2.running_var", "module.pretrained.layer4.0.bn2.num_batches_tracked", "module.pretrained.layer4.0.conv3.weight", "module.pretrained.layer4.0.bn3.weight", "module.pretrained.layer4.0.bn3.bias", "module.pretrained.layer4.0.bn3.running_mean", "module.pretrained.layer4.0.bn3.running_var", "module.pretrained.layer4.0.bn3.num_batches_tracked", "module.pretrained.layer4.0.downsample.0.weight", "module.pretrained.layer4.0.downsample.1.weight", "module.pretrained.layer4.0.downsample.1.bias", "module.pretrained.layer4.0.downsample.1.running_mean", "module.pretrained.layer4.0.downsample.1.running_var", "module.pretrained.layer4.0.downsample.1.num_batches_tracked", "module.pretrained.layer4.1.conv1.weight", "module.pretrained.layer4.1.bn1.weight", "module.pretrained.layer4.1.bn1.bias", "module.pretrained.layer4.1.bn1.running_mean", "module.pretrained.layer4.1.bn1.running_var", "module.pretrained.layer4.1.bn1.num_batches_tracked", "module.pretrained.layer4.1.conv2.weight", "module.pretrained.layer4.1.bn2.weight", "module.pretrained.layer4.1.bn2.bias", "module.pretrained.layer4.1.bn2.running_mean", "module.pretrained.layer4.1.bn2.running_var", "module.pretrained.layer4.1.bn2.num_batches_tracked", "module.pretrained.layer4.1.conv3.weight", "module.pretrained.layer4.1.bn3.weight", "module.pretrained.layer4.1.bn3.bias", "module.pretrained.layer4.1.bn3.running_mean", "module.pretrained.layer4.1.bn3.running_var", "module.pretrained.layer4.1.bn3.num_batches_tracked", "module.pretrained.layer4.2.conv1.weight", "module.pretrained.layer4.2.bn1.weight", "module.pretrained.layer4.2.bn1.bias", "module.pretrained.layer4.2.bn1.running_mean", "module.pretrained.layer4.2.bn1.running_var", "module.pretrained.layer4.2.bn1.num_batches_tracked", "module.pretrained.layer4.2.conv2.weight", "module.pretrained.layer4.2.bn2.weight", "module.pretrained.layer4.2.bn2.bias", "module.pretrained.layer4.2.bn2.running_mean", "module.pretrained.layer4.2.bn2.running_var", "module.pretrained.layer4.2.bn2.num_batches_tracked", "module.pretrained.layer4.2.conv3.weight", "module.pretrained.layer4.2.bn3.weight", "module.pretrained.layer4.2.bn3.bias", "module.pretrained.layer4.2.bn3.running_mean", "module.pretrained.layer4.2.bn3.running_var", "module.pretrained.layer4.2.bn3.num_batches_tracked", "module.pretrained.fc.weight", "module.pretrained.fc.bias", "module.head.0.weight", "module.head.0.bias", "module.head.1.weight", "module.head.1.bias", "module.head.1.running_mean", "module.head.1.running_var", "module.head.1.num_batches_tracked", "module.head.3.codewords", "module.head.3.scale", "module.head.6.weight", "module.head.6.bias".

I have successfully done the prior instructions but I don't know why I missed these keys and had those unexpected keys. It seems like something got messed up in deepten_minc.pth. Could you help me solve this problems? Thanks! my_env: pytorch 0.4.1, anaconda3, python 3.6, macOS

weather you solve this problem? i meet the same problem like you ~

zhanghang1989 commented 3 years ago

Hi, I haven't tried minc model for a while. Let me try it and get back to you.

This sounds like a naming issue.

sundongwei commented 3 years ago

Hi, I haven't tried minc model for a while. Let me try it and get back to you.

This sounds like a naming issue.

thank your for your reply.

zuyuxin commented 3 years ago

Thanks, it works for me!

you can use strict=False in load_state_dict. This can solved the issue.

model.load_state_dict(checkpoint['state_dict'], strict=False)
bluesoulo commented 3 years ago

you can use strict=False in load_state_dict. This can solved the issue.

model.load_state_dict(checkpoint['state_dict'], strict=False)

it works!

wlj567 commented 2 years ago

Hi, I used strict=False to solve the problem, but the result of segmentation is very poor. What's the matter?