JacobYuan7 / DIN-Group-Activity-Recognition-Benchmark

[ICCV 2021] A new codebase containing various methods for Group Activity Recognition. Paper title: Spatio-Temporal Dynamic Inference Network for Group Activity Recognition.
MIT License
52 stars 15 forks source link

RuntimeError: Error(s) in loading state_dict for Linear: size mismatch for weight: copying a param with shape torch.Size([1024, 26400]) from checkpoint, the shape in current model is torch.Size([1024, 12800]). #11

Closed Zxl1556180489 closed 1 year ago

Zxl1556180489 commented 2 years ago

Traceback (most recent call last): File "scripts/train_collective_stage2_dynamic.py", line 58, in train_net(cfg) File "./train_net_dynamic.py", line 83, in train_net model.loadmodel(cfg.stage1_model_path) File "./infer_model.py", line 1222, in loadmodel self.fc_emb_1.load_state_dict(state['fc_emb_state_dict']) File "/home/hi/.conda/envs/lj0.1/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1045, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for Linear: size mismatch for weight: copying a param with shape torch.Size([1024, 26400]) from checkpoint, the shape in current model is torch.Size([1024, 12800]).

Zxl1556180489 commented 2 years ago

How to solve this problem?

ch-its commented 2 years ago

I am facing the same issue. Were you able to resolve it ??

Zxl1556180489 commented 2 years ago

I am facing the same issue. Were you able to resolve it ??

yes, you can contact me via WeChat 15074682652

ch-its commented 2 years ago

WeChat isn't available in my region, is there some other way I can contact you??

Or can you explain the solution here itself??

JacobYuan7 commented 1 year ago

Traceback (most recent call last): File "scripts/train_collective_stage2_dynamic.py", line 58, in train_net(cfg) File "./train_net_dynamic.py", line 83, in train_net model.loadmodel(cfg.stage1_model_path) File "./infer_model.py", line 1222, in loadmodel self.fc_emb_1.load_state_dict(state['fc_emb_state_dict']) File "/home/hi/.conda/envs/lj0.1/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1045, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for Linear: size mismatch for weight: copying a param with shape torch.Size([1024, 26400]) from checkpoint, the shape in current model is torch.Size([1024, 12800]).

Sorry for this late reply. You may need to check the out_size in the script to align it with the actual output size.