OpenGVLab / OpenGVLab/InternVideo

finetune stage2 of Internvideo2 with num_frames 12 error

Open
#271 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.