pytorch / pytorch/vision

Using list as path/clips/frames containers lead to memory leaks for very large datasets and num_workers>1

Open
#8,169 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

https://github.com/pytorch/vision/blob/6c2e0ae88b056ba2ac897d4a7c1b7153cefcb444/torchvision/datasets/video_utils.py#L73C1-L73C1

Hi,

The class VideoClips uses the list datastructure to store video_paths, clips, frame_rate etc. However, In multi-dataloader workers paradigm and for very large datasets (Kinetics400/700), this leads to memory leaks. This is described in this issue

https://github.com/pytorch/pytorch/issues/13246

Please replace it with either torch tensor/panadas dataframe/ numpy arrays

Contributor guide

Open the contributing guide

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 linked VideoClips implementation in torchvision/datasets/video_utils.py and read the referenced PyTorch issue for context on multiprocessing memory growth. The issue proposes replacing list-based containers with tensor, dataframe, or NumPy alternatives; done means addressing the reported memory problem for large datasets with multiple workers.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
computer-vision, data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.