924973292 / EDITOR

【CVPR2024】Magic Tokens: Select Diverse Tokens for Multi-modal Object Re-Identification
MIT License
82 stars 5 forks source link

AttributeError: 'dict' object has no attribute 'shape' #4

Closed dbdikcn closed 7 months ago

dbdikcn commented 7 months ago

Traceback (most recent call last): File "/home/tiancun/EDITOR/modeling/backbones/vit_pytorch.py", line 666, in load_param self.statedict()[k].copy(v) KeyError: 'state_dict_ema'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/tiancun/EDITOR/train_net.py", line 71, in model = make_model(cfg, num_class=num_classes, camera_num=camera_num) File "/home/tiancun/EDITOR/modeling/make_model.py", line 372, in make_model model = EDITOR(num_class, cfg, camera_num, __factory_T_type) File "/home/tiancun/EDITOR/modeling/make_model.py", line 89, in init self.BACKBONE = build_transformer(num_classes, cfg, camera_num, factory) File "/home/tiancun/EDITOR/modeling/make_model.py", line 63, in init self.base.load_param(model_path) File "/home/tiancun/EDITOR/modeling/backbones/vit_pytorch.py", line 669, in load_param print('shape do not match in k :{}: param_dict{} vs self.state_dict(){}'.format(k, v.shape, AttributeError: 'dict' object has no attribute 'shape'

Sorry to bother you. When I was training RGBNT201, I used pre-training 82.6_T2T_ViTt_24_pth and this error occurred. How did you solve it?

924973292 commented 7 months ago

Feel free to ask!

截屏2024-03-30 11 11 35

The 'load param' code in the backbone is identical to that used in TOP-ReID. In TOP-ReID, I didn't make any adjustments when loading the parameters. You should set the checkpoint here and verify whether the param_dict has been loaded correctly.

dbdikcn commented 7 months ago

I'm sorry to bother you. I have confirmed that the param_dict failed to load successfully. But there is no solution yet.

924973292 commented 7 months ago

That's all right, check my personal website, and you can find my QQ or WeChat, we can communicate easily!

dbdikcn commented 7 months ago

Well. I add your qq

ChenCherry commented 1 month ago

你好 我也遇到相同问题 请问怎么解决的