OpenGVLab / OpenGVLab/InternVideo
finetune stage2 of Internvideo2 with num_frames 12 error
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.4k
- Forks
- 160
- PR merge metrics
- No merged PRs in 30d
Description
When I try to finetune stage2 of Internvideo2 with num_frames 12, I meet the error below:
[rank0]: File "/root/nginx/multi_modality/tasks/shared_utils.py", line 192, in setup_model
[rank0]: msg = model_without_ddp.load_state_dict(state_dict, strict=False)
[rank0]: File "/usr/local/Python3.8.12/lib/python3.8/site-packages/torch/nn/modules/module.py", line 2215, in load_state_dict
[rank0]: raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
[rank0]: RuntimeError: Error(s) in loading state_dict for InternVideo2_Stage2:
[rank0]: size mismatch for vision_encoder.pos_embed: copying a param with shape torch.Size([1, 1025, 1408]) from checkpoint, the shape in current model is torch.Size([1, 3073, 1408]).
How to solve it? Looking forward to your reply. Thanks.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in tasks/shared_utils.py at line 192, where setup_model loads the state dict, and reproduce stage2 finetuning with num_frames 12. Compare the checkpoint and current model shapes reported for vision_encoder.pos_embed, then verify that the corrected loading path completes without the size-mismatch error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100