Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VideoReader initialization becomes very slow after loading many videos #280

Open
alexnwang opened this issue Nov 2, 2023 · 0 comments
Open

Comments

@alexnwang
Copy link

Decord installed with pip, observed usingVideoReader alongside the Pytorch dataloader for decoding videos.
Code looks something like:

class Dataset
     def __getitem__(self, idx):
          vr = VideoLoader(self.video_paths[idx], num_threads=1, device=cpu(0))
          images = vr.get_batch([...]).asnumpy()
          return images

However, after some number of examples, (dependent on num_workers), creating the VideoLoader takes up to 10 seconds, my CPU utilization drops significantly and dataloading becomes 3-4x slower.

I've tried including del vr and gc.collect() as from #1 (comment). I've also attempted to set the environment variable DECORD_NUM_THREADS as well different num_workers in the pytorch dataloader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant