Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

how to load the pretrain model #15

Open
NanWangAC opened this issue Dec 8, 2020 · 0 comments
Open

how to load the pretrain model #15

NanWangAC opened this issue Dec 8, 2020 · 0 comments

Comments

@NanWangAC
Copy link

model = san.san(sa_type=1, layers=[3, 2, 3, 5, 2], kernels=[3, 7, 7, 7, 7], num_classes=1000).cuda() model.load_state_dict(torch.load('./san15_patchwise/model/model_best.pth'))

RuntimeError: Error(s) in loading state_dict for SAN:
Missing key(s) in state_dict: "conv_in.weight", "bn_in.weight", "bn_in.bias", "bn_in.running_mean", "bn_in.running_var", "conv0.weight", "bn0.weight", "bn0.bias", "bn0.running_mean", "bn0.running_var", "layer0.0.bn1.weight", "layer0.0.bn1.bias", "layer0.0.bn1.running_mean", "layer0.0.bn1.running_var", "layer0.0.sam.conv1.weight", "layer0.0.sam.conv1.bias", "layer0.0.sam.conv2.weight", "layer0.0.sam.conv2.bias", "layer0.0.sam.conv3.weight", "layer0.0.sam.conv3.bias", "layer0.0.sam.conv_w.0.weight", "layer0.0.sam.conv_w.0.bias", "layer0.0.sam.conv_w.0.running_mean", "layer0.0.sam.conv_w.0.running_var", "layer0.0.sam.conv_w.2.weight", "layer0.0.sam.conv_w.3.weight", "layer0.0.sam.conv_w.3.bias", "layer0.0.sam.conv_w.3.running_mean", "layer0.0.sam.conv_w.3.running_var", "layer0.0.sam.conv_w.5.weight", "layer0.0.sam.conv_w.5.bias", "layer0.0.bn2.weight", "layer0.0.bn2.bias", "layer0.0.bn2.running_mean", "layer0.0.bn2.running_var", "layer0.0.conv.weight", "layer0.0.conv.bias", "layer0.1.bn1.weight", "layer0.1.bn1.bias", "layer0.1.bn1.running_mean", "layer0.1.bn1.running_var", "layer0.1.sam.conv1.weight", "layer0.1.sam.conv1.bias", "layer0.1.sam.conv2.weight", "layer0.1.sam.conv2.bias", "layer0.1.sam.conv3.weight", "layer0.1.sam.conv3.bias", "layer0.1.sam.conv_w.0.weight", "layer0.1.sam.conv_w.0.bias", "layer0.1.sam.conv_w.0.running_mean", "layer0.1.sam.conv_w.0.running_var", "layer0.1.sam.conv_w.2.weight", "layer0.1.sam.conv_w.3.weight", "layer0.1.sam.conv_w.3.bias", "layer0.1.sam.conv_w.3.running_mean", "layer0.1.sam.conv_w.3.running_var", "layer0.1.sam.conv_w.5.weight", "layer0.1.sam.conv_w.5.bias", "layer0.1.bn2.weight", "layer0.1.bn2.bias", "layer0.1.bn2.running_mean", "layer0.1.bn2.running_var", "layer0.1.conv.weight", "layer0.1.conv.bias", "layer0.2.bn1.weight", "layer0.2.bn1.bias", "layer0.2.bn1.running_mean", "layer0.2.bn1.running_var", "layer0.2.sam.conv1.weight", "layer0.2.sam.conv1.bias", "layer0.2.sam.conv2.weight", "layer0.2.sam.conv2.bias", "layer0.2.sam.conv3.weight", "layer0.2.sam.conv3.bias", "layer0.2.sam.conv_w.0.weight", "layer0.2.sam.conv_w.0.bias", "layer0.2.sam.conv_w.0.running_mean", "layer0.2.sam.conv_w.0.running_var", "layer0.2.sam.conv_w.2.weight", "layer0.2.sam.conv_w.3.weight", "layer0.2.sam.conv_w.3.bias", "layer0.2.sam.conv_w.3.running_mean", "layer0.2.sam.conv_w.3.running_var", "layer0.2.sam.conv_w.5.weight", "layer0.2.sam.conv_w.5.bias", "layer0.2.bn2.weight", "layer0.2.bn2.bias", "layer0.2.bn2.running_mean", "layer0.2.bn2.running_var", "layer0.2.conv.weight", "layer0.2.conv.bias", "conv1.weight", "bn1.weight", "bn1.bias", "bn1.running_mean", "bn1.running_var", "layer1.0.bn1.weight", "layer1.0.bn1.bias", "layer1.0.bn1.running_mean", "layer1.0.bn1.running_var", "layer1.0.sam.conv1.weight", "layer1.0.sam.conv1.bias", "layer1.0.sam.conv2.weight", "layer1.0.sam.conv2.bias", "layer1.0.sam.conv3.weight", "layer1.0.sam.conv3.bias", "layer1.0.sam.conv_w.0.weight", "layer1.0.sam.conv_w.0.bias", "layer1.0.sam.conv_w.0.running_mean", "layer1.0.sam.conv_w.0.running_var", "layer1.0.sam.conv_w.2.weight", "layer1.0.sam.conv_w.3.weight", "layer1.0.sam.conv_w.3.bias", "layer1.0.sam.conv_w.3.running_mean", "layer1.0.sam.conv_w.3.running_var", "layer1.0.sam.conv_w.5.weight", "layer1.0.sam.conv_w.5.bias", "layer1.0.bn2.weight", "layer1.0.bn2.bias", "layer1.0.bn2.running_mean", "layer1.0.bn2.running_var", "layer1.0.conv.weight", "layer1.0.conv.bias", "layer1.1.bn1.weight", "layer1.1.bn1.bias", "layer1.1.bn1.running_mean", "layer1.1.bn1.running_var", "layer1.1.sam.conv1.weight", "layer1.1.sam.conv1.bias", "layer1.1.sam.conv2.weight", "layer1.1.sam.conv2.bias", "layer1.1.sam.conv3.weight", "layer1.1.sam.conv3.bias", "layer1.1.sam.conv_w.0.weight", "layer1.1.sam.conv_w.0.bias", "layer1.1.sam.conv_w.0.running_mean", "layer1.1.sam.conv_w.0.running_var", "layer1.1.sam.conv_w.2.weight", "layer1.1.sam.conv_w.3.weight", "layer1.1.sam.conv_w.3.bias", "layer1.1.sam.conv_w.3.running_mean", "layer1.1.sam.conv_w.3.running_var", "layer1.1.sam.conv_w.5.weight", "layer1.1.sam.conv_w.5.bias", "layer1.1.bn2.weight", "layer1.1.bn2.bias", "layer1.1.bn2.running_mean", "layer1.1.bn2.running_var", "layer1.1.conv.weight", "layer1.1.conv.bias", "conv2.weight", "bn2.weight", "bn2.bias", "bn2.running_mean", "bn2.running_var", "layer2.0.bn1.weight", "layer2.0.bn1.bias", "layer2.0.bn1.running_mean", "layer2.0.bn1.running_var", "layer2.0.sam.conv1.weight", "layer2.0.sam.conv1.bias", "layer2.0.sam.conv2.weight", "layer2.0.sam.conv2.bias", "layer2.0.sam.conv3.weight", "layer2.0.sam.conv3.bias", "layer2.0.sam.conv_w.0.weight", "layer2.0.sam.conv_w.0.bias", "layer2.0.sam.conv_w.0.running_mean", "layer2.0.sam.conv_w.0.running_var", "layer2.0.sam.conv_w.2.weight", "layer2.0.sam.conv_w.3.weight", "layer2.0.sam.conv_w.3.bias", "layer2.0.sam.conv_w.3.running_mean", "layer2.0.sam.conv_w.3.running_var", "layer2.0.sam.conv_w.5.weight", "layer2.0.sam.conv_w.5.bias", "layer2.0.bn2.weight", "layer2.0.bn2.bias", "layer2.0.bn2.running_mean", "layer2.0.bn2.running_var", "layer2.0.conv.weight", "layer2.0.conv.bias", "layer2.1.bn1.weight", "layer2.1.bn1.bias", "layer2.1.bn1.running_mean", "layer2.1.bn1.running_var", "layer2.1.sam.conv1.weight", "layer2.1.sam.conv1.bias", "layer2.1.sam.conv2.weight", "layer2.1.sam.conv2.bias", "layer2.1.sam.conv3.weight", "layer2.1.sam.conv3.bias", "layer2.1.sam.conv_w.0.weight", "layer2.1.sam.conv_w.0.bias", "layer2.1.sam.conv_w.0.running_mean", "layer2.1.sam.conv_w.0.running_var", "layer2.1.sam.conv_w.2.weight", "layer2.1.sam.conv_w.3.weight", "layer2.1.sam.conv_w.3.bias", "layer2.1.sam.conv_w.3.running_mean", "layer2.1.sam.conv_w.3.running_var", "layer2.1.sam.conv_w.5.weight", "layer2.1.sam.conv_w.5.bias", "layer2.1.bn2.weight", "layer2.1.bn2.bias", "layer2.1.bn2.running_mean", "layer2.1.bn2.running_var", "layer2.1.conv.weight", "layer2.1.conv.bias", "layer2.2.bn1.weight", "layer2.2.bn1.bias", "layer2.2.bn1.running_mean", "layer2.2.bn1.running_var", "layer2.2.sam.conv1.weight", "layer2.2.sam.conv1.bias", "layer2.2.sam.conv2.weight", "layer2.2.sam.conv2.bias", "layer2.2.sam.conv3.weight", "layer2.2.sam.conv3.bias", "layer2.2.sam.conv_w.0.weight", "layer2.2.sam.conv_w.0.bias", "layer2.2.sam.conv_w.0.running_mean", "layer2.2.sam.conv_w.0.running_var", "layer2.2.sam.conv_w.2.weight", "layer2.2.sam.conv_w.3.weight", "layer2.2.sam.conv_w.3.bias", "layer2.2.sam.conv_w.3.running_mean", "layer2.2.sam.conv_w.3.running_var", "layer2.2.sam.conv_w.5.weight", "layer2.2.sam.conv_w.5.bias", "layer2.2.bn2.weight", "layer2.2.bn2.bias", "layer2.2.bn2.running_mean", "layer2.2.bn2.running_var", "layer2.2.conv.weight", "layer2.2.conv.bias", "conv3.weight", "bn3.weight", "bn3.bias", "bn3.running_mean", "bn3.running_var", "layer3.0.bn1.weight", "layer3.0.bn1.bias", "layer3.0.bn1.running_mean", "layer3.0.bn1.running_var", "layer3.0.sam.conv1.weight", "layer3.0.sam.conv1.bias", "layer3.0.sam.conv2.weight", "layer3.0.sam.conv2.bias", "layer3.0.sam.conv3.weight", "layer3.0.sam.conv3.bias", "layer3.0.sam.conv_w.0.weight", "layer3.0.sam.conv_w.0.bias", "layer3.0.sam.conv_w.0.running_mean", "layer3.0.sam.conv_w.0.running_var", "layer3.0.sam.conv_w.2.weight", "layer3.0.sam.conv_w.3.weight", "layer3.0.sam.conv_w.3.bias", "layer3.0.sam.conv_w.3.running_mean", "layer3.0.sam.conv_w.3.running_var", "layer3.0.sam.conv_w.5.weight", "layer3.0.sam.conv_w.5.bias", "layer3.0.bn2.weight", "layer3.0.bn2.bias", "layer3.0.bn2.running_mean", "layer3.0.bn2.running_var", "layer3.0.conv.weight", "layer3.0.conv.bias", "layer3.1.bn1.weight", "layer3.1.bn1.bias", "layer3.1.bn1.running_mean", "layer3.1.bn1.running_var", "layer3.1.sam.conv1.weight", "layer3.1.sam.conv1.bias", "layer3.1.sam.conv2.weight", "layer3.1.sam.conv2.bias", "layer3.1.sam.conv3.weight", "layer3.1.sam.conv3.bias", "layer3.1.sam.conv_w.0.weight", "layer3.1.sam.conv_w.0.bias", "layer3.1.sam.conv_w.0.running_mean", "layer3.1.sam.conv_w.0.running_var", "layer3.1.sam.conv_w.2.weight", "layer3.1.sam.conv_w.3.weight", "layer3.1.sam.conv_w.3.bias", "layer3.1.sam.conv_w.3.running_mean", "layer3.1.sam.conv_w.3.running_var", "layer3.1.sam.conv_w.5.weight", "layer3.1.sam.conv_w.5.bias", "layer3.1.bn2.weight", "layer3.1.bn2.bias", "layer3.1.bn2.running_mean", "layer3.1.bn2.running_var", "layer3.1.conv.weight", "layer3.1.conv.bias", "layer3.2.bn1.weight", "layer3.2.bn1.bias", "layer3.2.bn1.running_mean", "layer3.2.bn1.running_var", "layer3.2.sam.conv1.weight", "layer3.2.sam.conv1.bias", "layer3.2.sam.conv2.weight", "layer3.2.sam.conv2.bias", "layer3.2.sam.conv3.weight", "layer3.2.sam.conv3.bias", "layer3.2.sam.conv_w.0.weight", "layer3.2.sam.conv_w.0.bias", "layer3.2.sam.conv_w.0.running_mean", "layer3.2.sam.conv_w.0.running_var", "layer3.2.sam.conv_w.2.weight", "layer3.2.sam.conv_w.3.weight", "layer3.2.sam.conv_w.3.bias", "layer3.2.sam.conv_w.3.running_mean", "layer3.2.sam.conv_w.3.running_var", "layer3.2.sam.conv_w.5.weight", "layer3.2.sam.conv_w.5.bias", "layer3.2.bn2.weight", "layer3.2.bn2.bias", "layer3.2.bn2.running_mean", "layer3.2.bn2.running_var", "layer3.2.conv.weight", "layer3.2.conv.bias", "layer3.3.bn1.weight", "layer3.3.bn1.bias", "layer3.3.bn1.running_mean", "layer3.3.bn1.running_var", "layer3.3.sam.conv1.weight", "layer3.3.sam.conv1.bias", "layer3.3.sam.conv2.weight", "layer3.3.sam.conv2.bias", "layer3.3.sam.conv3.weight", "layer3.3.sam.conv3.bias", "layer3.3.sam.conv_w.0.weight", "layer3.3.sam.conv_w.0.bias", "layer3.3.sam.conv_w.0.running_mean", "layer3.3.sam.conv_w.0.running_var", "layer3.3.sam.conv_w.2.weight", "layer3.3.sam.conv_w.3.weight", "layer3.3.sam.conv_w.3.bias", "layer3.3.sam.conv_w.3.running_mean", "layer3.3.sam.conv_w.3.running_var", "layer3.3.sam.conv_w.5.weight", "layer3.3.sam.conv_w.5.bias", "layer3.3.bn2.weight", "layer3.3.bn2.bias", "layer3.3.bn2.running_mean", "layer3.3.bn2.running_var", "layer3.3.conv.weight", "layer3.3.conv.bias", "layer3.4.bn1.weight", "layer3.4.bn1.bias", "layer3.4.bn1.running_mean", "layer3.4.bn1.running_var", "layer3.4.sam.conv1.weight", "layer3.4.sam.conv1.bias", "layer3.4.sam.conv2.weight", "layer3.4.sam.conv2.bias", "layer3.4.sam.conv3.weight", "layer3.4.sam.conv3.bias", "layer3.4.sam.conv_w.0.weight", "layer3.4.sam.conv_w.0.bias", "layer3.4.sam.conv_w.0.running_mean", "layer3.4.sam.conv_w.0.running_var", "layer3.4.sam.conv_w.2.weight", "layer3.4.sam.conv_w.3.weight", "layer3.4.sam.conv_w.3.bias", "layer3.4.sam.conv_w.3.running_mean", "layer3.4.sam.conv_w.3.running_var", "layer3.4.sam.conv_w.5.weight", "layer3.4.sam.conv_w.5.bias", "layer3.4.bn2.weight", "layer3.4.bn2.bias", "layer3.4.bn2.running_mean", "layer3.4.bn2.running_var", "layer3.4.conv.weight", "layer3.4.conv.bias", "conv4.weight", "bn4.weight", "bn4.bias", "bn4.running_mean", "bn4.running_var", "layer4.0.bn1.weight", "layer4.0.bn1.bias", "layer4.0.bn1.running_mean", "layer4.0.bn1.running_var", "layer4.0.sam.conv1.weight", "layer4.0.sam.conv1.bias", "layer4.0.sam.conv2.weight", "layer4.0.sam.conv2.bias", "layer4.0.sam.conv3.weight", "layer4.0.sam.conv3.bias", "layer4.0.sam.conv_w.0.weight", "layer4.0.sam.conv_w.0.bias", "layer4.0.sam.conv_w.0.running_mean", "layer4.0.sam.conv_w.0.running_var", "layer4.0.sam.conv_w.2.weight", "layer4.0.sam.conv_w.3.weight", "layer4.0.sam.conv_w.3.bias", "layer4.0.sam.conv_w.3.running_mean", "layer4.0.sam.conv_w.3.running_var", "layer4.0.sam.conv_w.5.weight", "layer4.0.sam.conv_w.5.bias", "layer4.0.bn2.weight", "layer4.0.bn2.bias", "layer4.0.bn2.running_mean", "layer4.0.bn2.running_var", "layer4.0.conv.weight", "layer4.0.conv.bias", "layer4.1.bn1.weight", "layer4.1.bn1.bias", "layer4.1.bn1.running_mean", "layer4.1.bn1.running_var", "layer4.1.sam.conv1.weight", "layer4.1.sam.conv1.bias", "layer4.1.sam.conv2.weight", "layer4.1.sam.conv2.bias", "layer4.1.sam.conv3.weight", "layer4.1.sam.conv3.bias", "layer4.1.sam.conv_w.0.weight", "layer4.1.sam.conv_w.0.bias", "layer4.1.sam.conv_w.0.running_mean", "layer4.1.sam.conv_w.0.running_var", "layer4.1.sam.conv_w.2.weight", "layer4.1.sam.conv_w.3.weight", "layer4.1.sam.conv_w.3.bias", "layer4.1.sam.conv_w.3.running_mean", "layer4.1.sam.conv_w.3.running_var", "layer4.1.sam.conv_w.5.weight", "layer4.1.sam.conv_w.5.bias", "layer4.1.bn2.weight", "layer4.1.bn2.bias", "layer4.1.bn2.running_mean", "layer4.1.bn2.running_var", "layer4.1.conv.weight", "layer4.1.conv.bias", "fc.weight", "fc.bias".
Unexpected key(s) in state_dict: "epoch", "state_dict", "optimizer", "scheduler", "top1_val", "top5_val".

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant