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

VideoDataset Deadlock and error #8322

Open
JK-rez opened this issue Feb 2, 2025 · 0 comments · May be fixed by #8323
Open

VideoDataset Deadlock and error #8322

JK-rez opened this issue Feb 2, 2025 · 0 comments · May be fixed by #8323

Comments

@JK-rez
Copy link

JK-rez commented Feb 2, 2025

Describe the bug

OpenCV VideoCapture object deadlocks the data loader or throws different errors when multiple workers try to access the same video file. The current logic implemented in the dataset is workable for Linux env but not Windows. The self.multiprocessing attribute doesn't prevent num_worker > 0 from being handled either.

To Reproduce
dataset = VideoFileDataset(video_source = "video.mp4", multiprocessing = True)
dataloader = torch.utils.data.Dataloader(dataset, batch_size = 2, num_worker = 2)
for batch in dataloader:
print(hello)

Expected behaviour
Dataloader will deadlock when trying to create the same cv2.VideoCapture object on same video (behaviour could be different in different video files)

Screenshots
If applicable, add screenshots to help explain your problem.

Environment

Windows
Pyhton > 3.9

@JK-rez JK-rez linked a pull request Feb 2, 2025 that will close this issue
7 tasks
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

Successfully merging a pull request may close this issue.

1 participant