OpenGVLab / OpenGVLab/InternVideo

When finetuning, len(train_loader)==0, ZeroDivisionError: integer division or modulo by zero in tasks/pretrain.py

Open
#260 1 comment 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

I want to finetune the InternVideo2-Stage2_1B-224p-f4 on activitynet. I adjust the data in data.py.
My data is:

available_corpus["anet_ret_val"] = dict( anno_path=".../ActivityNet/anno_downstream/anet_ret_val.json", data_root=".../ActivityNet", media_type="video", is_paragraph_retrieval=True, max_txt_l = 150 ) available_corpus["anet_ret_train"] = dict( anno_path=".../ActivityNet/anno_downstream/anet_ret_train.json", data_root=".../ActivityNet", media_type="video", is_paragraph_retrieval=True, max_txt_l = 150 )

anet_ret_train.json data example:
[
{
"video": ".../ActivityNet/videos_images/v_QOlSCBRmfWY.mp4",
"caption": "A young woman is seen standing in a room and leads into her dancing.",
}
......
]

In pretrain.py I got len(train_loaders)=1, but len(train_loader)=0. So I got ZeroDivisionError: integer division or modulo by zero.
I carefully check the frame extraction, I found the frame and video are processed correctly. But MetaLoader has 1 dataloaders, 0 batches in total
Was it because I've done incorrect setting of some parameters?

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 with the ActivityNet corpus settings in data.py and follow their use into tasks/pretrain.py, focusing on MetaLoader and train_loader. Check how the supplied annotation and loader configuration produces the reported batch count. Done means the configured training loader contains batches and finetuning no longer reaches the division-by-zero error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.