facebookresearch / facebookresearch/SlowFast

Failed to load video after 10 retries

Open
#664 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7.4k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

I am trying to train a custom video classifier using pytorchvideo. The csv file looks like this:

file | label
-- | --
UCF_car_threat/normal/Normal_Videos_603_x264.mp4 | 0
UCF_car_threat/threat/Shooting019_x264.mp4 | 1
UCF_car_threat/threat/Shooting030_x264.mp4 | 1
UCF_car_threat/threat/Stealing009_x264.mp4 | 1
UCF_car_threat/normal/Normal_Videos_401_x264.mp4 | 0

I am creating dataloader using this:

`from torch.utils.data import DataLoader
train_dataset = LabeledVideoDataset(train_df, clip_sampler=make_clip_sampler('random', 2), transform=video_transform, decode_audio=False)
loader = DataLoader(train_dataset, batch_size=3, num_workers=0, pin_memory=True)

batch = next(iter(loader))`

`RuntimeError Traceback (most recent call last)
Cell In[28], line 1
----> 1 batch = next(iter(loader))

File [~/anaconda3/envs/threat/lib/python3.10/site-packages/torch/utils/data/dataloader.py:633](https://file+.vscode-resource.vscode-cdn.net/home/aidev/VectraCom/threat_detection/~/anaconda3/envs/threat/lib/python3.10/site-packages/torch/utils/data/dataloader.py:633), in _BaseDataLoaderIter.__next__(self)
630 if self._sampler_iter is None:
631 # TODO(https://github.com/pytorch/pytorch/issues/76750)
632 self._reset() # type: ignore[call-arg]
--> 633 data = self._next_data()
634 self._num_yielded += 1
635 if self._dataset_kind == _DatasetKind.Iterable and \
636 self._IterableDataset_len_called is not None and \
637 self._num_yielded > self._IterableDataset_len_called:

File [~/anaconda3/envs/threat/lib/python3.10/site-packages/torch/utils/data/dataloader.py:677](https://file+.vscode-resource.vscode-cdn.net/home/aidev/VectraCom/threat_detection/~/anaconda3/envs/threat/lib/python3.10/site-packages/torch/utils/data/dataloader.py:677), in _SingleProcessDataLoaderIter._next_data(self)
675 def _next_data(self):
676 index = self._next_index() # may raise StopIteration
--> 677 data = self._dataset_fetcher.fetch(index) # may raise StopIteration
678 if self._pin_memory:
679 data = _utils.pin_memory.pin_memory(data, self._pin_memory_device)

File [~/anaconda3/envs/threat/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py:32](https://file+.vscode-resource.vscode-cdn.net/home/aidev/VectraCom/threat_detection/~/anaconda3/envs/threat/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py:32), in _IterableDatasetFetcher.fetch(self, possibly_batched_index)
30 for _ in possibly_batched_index:
31 try:
...
--> 225 raise RuntimeError(
226 f"Failed to load video after {self._MAX_CONSECUTIVE_FAILURES} retries."
227 )

RuntimeError: Failed to load video after 10 retries.`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.