OpenDriveLab / UniAD

[CVPR 2023 Best Paper Award] Planning-oriented Autonomous Driving
Apache License 2.0
3.57k stars 406 forks source link

A problem: "The model and loaded state dict do not match exactly", when I try to run the "Evaluation Example". #191

Closed Rango-T10000 closed 5 months ago

Rango-T10000 commented 5 months ago

Hello, I have prepared the environment and the nuScenes dataset according to your instruction. However, when I try to evaluate the pre-trained first-stage(track_map) model as your instruction: ./tools/uniad_dist_eval.sh ./projects/configs/stage1_track_map/base_track_map.py ./ckpts/uniad_base_track_map.pth 3

I met a problem that says: The model and loaded state dict do not match exactly! It seems too many parameters' state dict mismatchs the model:"uniad_base_track_map.pth" because something is upgraded to version 2.

image image image image

I really need your help. Really thanks.

Rango-T10000 commented 5 months ago

https://blog.csdn.net/h904798869/article/details/138255214

Rango-T10000 commented 5 months ago

Hi @Rango-T10000 I found a solution for the same problem by replacing self.class_names = self.class_range.keys() with self.class_names = list(self.class_range.keys()) in python3.8/site-packages/nuscenes/eval/detection/data_classes.py, which is from this article.

Hi, thanks for your reply. However, my error is: "The model and loaded state dict do not match exactly", when I run:"./tools/uniad_dist_eval.sh ./projects/configs/stage1_track_map/base_track_map.py ./ckpts/uniad_base_track_map.pth 1"

And I can't find a file in python3.8/site-packages/nuscenes/eval/detection/data_classes.py

YTEP-ZHI commented 5 months ago

Hi @Rango-T10000, you can ignore the warning of mismatched keys, it won't lead to any trouble. In your case, the error comes from the dataset, not the model. It seems that something's wrong in your dataset preparation.

image
Rango-T10000 commented 5 months ago

Hi @Rango-T10000, you can ignore the warning of mismatched keys, it won't lead to any trouble. In your case, the error comes from the dataset, not the model. It seems that something's wrong in your dataset preparation. image

Thanks for your reply. Because I use the mini version dataset so there is something wrong. And when I download the whole version of the dataset, I still met this "The model and loaded state dict do not match exactly" error.

Accordind to your reply, I will ignore it and test again. Really thanks for your reply.

Rango-T10000 commented 4 months ago

Hi @Rango-T10000, you can ignore the warning of mismatched keys, it won't lead to any trouble. In your case, the error comes from the dataset, not the model. It seems that something's wrong in your dataset preparation. image