-
Notifications
You must be signed in to change notification settings - Fork 7k
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
UCF101: Dataloader Fail on assertion #4112
Comments
This is probably related to #3791, as now when using cc @prabhat00155 @bjuncek I've brought this potential problem during our call a few weeks ago, we should fix it |
Thank you for following up. |
@YanCote there is an easy workaround - I've submitted the PR and it's readily usable. |
Hi guys, I have the same problem loading ucf101 with |
Yup, it's now resolved on the latest main. |
@bjuncek How can I get these changes to my environment? By installing the nightly build? ex -
|
Hi @shehan360 Nightly build should work provided that you have |
How can I solve this problem? PyTorch =1.10.1 and TorchVision= 0.11.2 . |
🐛 Bug
When loading UCF101 with different value of frames_per_clip and step_between_clips, it often yield frames_per_clip + 1 images which results in the following assertion to fail:
Code To Reproduce
Steps to reproduce the behavior:
stack trace
Original Traceback (most recent call last):
File "/opt/miniconda3/envs/p38_ucf/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/opt/miniconda3/envs/p38_ucf/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/opt/miniconda3/envs/p38_ucf/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/opt/miniconda3/envs/p38_ucf/lib/python3.8/site-packages/torchvision/datasets/ucf101.py", line 102, in getitem
video, audio, info, video_idx = self.video_clips.get_clip(idx)
File "/opt/miniconda3/envs/p38_ucf/lib/python3.8/site-packages/torchvision/datasets/video_utils.py", line 382, in get_clip
assert len(video) == self.num_frames, "{} x {}".format(
AssertionError: torch.Size([6, 240, 320, 3]) x 5
Expected behavior
The return tensor data should be composed of a total of frames_per_clip images consistently no matter the properties of the input video and the parameter values provided to UCF101 class.
Environment
conda
,pip
, source): condaAdditional context
Preliminary Investigation:
My guess is that with the provided argument, _read_from_stream function return +/- 1 frames in video.py: read_video(). I did not dig deeper to understand why
The text was updated successfully, but these errors were encountered: