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

Checkpoint state_dict doesn't match. unexpected key. missing keys. #48

Open
siahuat0727 opened this issue Dec 13, 2023 · 1 comment
Open

Comments

@siahuat0727
Copy link

Hi, the state_dict checkpoint doesn't match the current model.
I'm wondering how to obtain a matching one.
This was also pointed out as a sub-issue in #14.

$ python tools/test.py configs/vectormapnet.py /home/me/vectormapnet.pth  --eval name
<frozen importlib._bootstrap>:219: RuntimeWarning: scipy._lib.messagestream.MessageStream size changed, may indicate binary incompatibility. Expected 56 from C header, got 64 from PyObject
plugin
work_dir:  ./work_dirs/vectormapnet
collecting samples...
collected 6019 samples in 0.30s
2023-12-13 01:44:03,157 - mmcv - INFO - load model from: open-mmlab://detectron2/resnet50_caffe
2023-12-13 01:44:03,158 - mmcv - INFO - Use load_from_openmmlab loader
Downloading: "https://download.openmmlab.com/pretrain/third_party/resnet50_msra-5891d200.pth" to /root/.cache/torch/hub/checkpoints/resnet50_msra-5891d200.pth
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 89.9M/89.9M [00:04<00:00, 20.0MB/s]
2023-12-13 01:44:13,163 - mmcv - WARNING - The model and loaded state dict do not match exactly

unexpected key in source state_dict: conv1.bias

missing keys in source state_dict: layer3.0.conv2.conv_offset.weight, layer3.0.conv2.conv_offset.bias, layer3.1.conv2.conv_offset.weight, layer3.1.conv2.conv_offset.bias, layer3.2.conv2.conv_offset.weight, layer3.2.conv2.conv_offset.bias, layer3.3.conv2.conv_offset.weight, layer3.3.conv2.conv_offset.bias, layer3.4.conv2.conv_offset.weight, layer3.4.conv2.conv_offset.bias, layer3.5.conv2.conv_offset.weight, layer3.5.conv2.conv_offset.bias, layer4.0.conv2.conv_offset.weight, layer4.0.conv2.conv_offset.bias, layer4.1.conv2.conv_offset.weight, layer4.1.conv2.conv_offset.bias, layer4.2.conv2.conv_offset.weight, layer4.2.conv2.conv_offset.bias

Use load_from_local loader
The model and loaded state dict do not match exactly

unexpected key in source state_dict: conv1x1.weight
@XYyao16
Copy link

XYyao16 commented Apr 28, 2024

Hello, I also encountered the same problem as you. Do you know how to solve the problem corresponding to this output? The map value I output in this way is very low.

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

2 participants