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

loading pretrained-model show error #1

Open
ZhaoWenjun123 opened this issue May 20, 2022 · 2 comments
Open

loading pretrained-model show error #1

ZhaoWenjun123 opened this issue May 20, 2022 · 2 comments

Comments

@ZhaoWenjun123
Copy link

I downloaded your pretrained model, but I got an error while loading
root@dl-0835182853-pod-jupyter-67cc9db95c-4gq8q:~/monocon_modifyV2-master/experiments/example# python ../../tools/train_val.py --config kitti_example.yaml --e 2022-05-20 20:48:28,228 INFO ################### Evaluation Only ################## 2022-05-20 20:48:34,673 INFO ==> Loading from checkpoint '/root/monocon_modifyV2-master/checkpoints/checkpoint_epoch_140.pth' Traceback (most recent call last): File "../../tools/train_val.py", line 81, in <module> main() File "../../tools/train_val.py", line 50, in main tester.test() File "/root/monocon_modifyV2-master/lib/helpers/tester_helper.py", line 36, in test logger=self.logger) File "/root/monocon_modifyV2-master/lib/helpers/save_helper.py", line 37, in load_checkpoint model.load_state_dict(checkpoint['model_state']) File "/root/.local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1052, in load_state_dict self.__class__.__name__, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for MonoCon: Missing key(s) in state_dict: "center2kpt_offset.0.weight", "center2kpt_offset.0.bias", "center2kpt_offset.2.weight", "center2kpt_offset.2.bias", "kpt_heatmap.0.weight", "kpt_heatmap.0.bias", "kpt_heatmap.2.weight", "kpt_heatmap.2.bias", "kpt_heatmap_offset.0.weight", "kpt_heatmap_offset.0.bias", "kpt_heatmap_offset.2.weight", "kpt_heatmap_offset.2.bias". size mismatch for heatmap.0.weight: copying a param with shape torch.Size([256, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 64, 3, 3]). size mismatch for heatmap.0.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for heatmap.2.weight: copying a param with shape torch.Size([3, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 64, 1, 1]). size mismatch for offset_2d.0.weight: copying a param with shape torch.Size([256, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 64, 3, 3]). size mismatch for offset_2d.0.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for offset_2d.2.weight: copying a param with shape torch.Size([2, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([2, 64, 1, 1]). size mismatch for size_2d.0.weight: copying a param with shape torch.Size([256, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 64, 3, 3]). size mismatch for size_2d.0.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for size_2d.2.weight: copying a param with shape torch.Size([2, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([2, 64, 1, 1]). size mismatch for depth.0.weight: copying a param with shape torch.Size([256, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 64, 3, 3]). size mismatch for depth.0.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for depth.2.weight: copying a param with shape torch.Size([2, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([2, 64, 1, 1]). size mismatch for offset_3d.0.weight: copying a param with shape torch.Size([256, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 64, 3, 3]). size mismatch for offset_3d.0.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for offset_3d.2.weight: copying a param with shape torch.Size([2, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([2, 64, 1, 1]). size mismatch for size_3d.0.weight: copying a param with shape torch.Size([256, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 64, 3, 3]). size mismatch for size_3d.0.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for size_3d.2.weight: copying a param with shape torch.Size([3, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 64, 1, 1]). size mismatch for heading.0.weight: copying a param with shape torch.Size([256, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 64, 3, 3]). size mismatch for heading.0.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for heading.2.weight: copying a param with shape torch.Size([24, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([24, 64, 1, 1]).

@ZhaoWenjun123
Copy link
Author

This is the performance after my training, far from the performance in the author's paper
Car [email protected], 0.70, 0.70:
bbox AP:96.3709, 92.1202, 84.8560
bev AP:22.6310, 18.1839, 15.9116
3d AP:15.8479, 12.4094, 11.1673
aos AP:95.91, 91.43, 83.64

@Senwang98
Copy link

Senwang98 commented Jan 29, 2023

@ZhaoWenjun123
hello, have you get the reason?
I found that the head's channel in this repo is 64, while the monodle's channel is 256.

I got the following results.

Car [email protected], 0.70, 0.70:
bbox AP:98.7093, 92.2566, 84.9337
bev  AP:24.9916, 19.0743, 16.5050
3d   AP:17.8765, 13.6974, 11.7378

The checkpoint provided by this repo's author has the following performance:

2023-01-29 22:57:20,035   INFO  Car [email protected], 0.70, 0.70:
bbox AP:90.1249, 88.3711, 79.8854
bev  AP:31.2481, 24.7352, 23.4494
3d   AP:23.7383, 20.7088, 17.9975
aos  AP:89.09, 87.18, 78.03
Car [email protected], 0.70, 0.70:
bbox AP:95.9643, 91.8798, 84.7518
bev  AP:25.8329, 20.7988, 18.1310
3d   AP:18.2511, 14.5574, 12.9762
aos  AP:94.81, 90.54, 82.53
Car [email protected], 0.50, 0.50:
bbox AP:90.1249, 88.3711, 79.8854
bev  AP:61.6220, 50.2440, 44.6793
3d   AP:57.7742, 44.3630, 42.4209
aos  AP:89.09, 87.18, 78.03
Car [email protected], 0.50, 0.50:
bbox AP:95.9643, 91.8798, 84.7518
bev  AP:61.4155, 47.3504, 41.9609
3d   AP:56.0406, 42.8349, 38.6653
aos  AP:94.81, 90.54, 82.53

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