Mrmoore98 / VectorMapNet_code

This is the official code base of VectorMapNet (ICML 2023)
https://tsinghua-mars-lab.github.io/vectormapnet/
GNU General Public License v3.0
391 stars 53 forks source link

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

Open siahuat0727 opened 7 months ago

siahuat0727 commented 7 months ago

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 commented 2 months ago

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.