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

AssertionError: torch.Size([17, 240, 320, 3]) x 16 #1

Open
Hyechul opened this issue Jul 13, 2022 · 0 comments
Open

AssertionError: torch.Size([17, 240, 320, 3]) x 16 #1

Hyechul opened this issue Jul 13, 2022 · 0 comments

Comments

@Hyechul
Copy link

Hyechul commented Jul 13, 2022

I installed pyav, ffmpeg on jupyter notebook. python 3.8, pytorch 1.11

image

when I ran this cell,

if name == 'main':
train(EPOCH)

the results are below:

current lr [0.003]

AssertionError Traceback (most recent call last)
Input In [31], in <cell line: 1>()
1 if name == 'main':
----> 2 train(EPOCH)

Input In [29], in train(epoch)
6 model.train()
8 print('current lr', scheduler.get_last_lr())
----> 9 for index, data in enumerate(trainset_loader):
10 video_clips, label = data
12 video_clips = video_clips.to(device)

File C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py:530, in _BaseDataLoaderIter.next(self)
528 if self._sampler_iter is None:
529 self._reset()
--> 530 data = self._next_data()
531 self._num_yielded += 1
532 if self._dataset_kind == _DatasetKind.Iterable and
533 self._IterableDataset_len_called is not None and
534 self._num_yielded > self._IterableDataset_len_called:

File C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py:570, in _SingleProcessDataLoaderIter._next_data(self)
568 def _next_data(self):
569 index = self._next_index() # may raise StopIteration
--> 570 data = self._dataset_fetcher.fetch(index) # may raise StopIteration
571 if self._pin_memory:
572 data = _utils.pin_memory.pin_memory(data)

File C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\torch\utils\data_utils\fetch.py:49, in _MapDatasetFetcher.fetch(self, possibly_batched_index)
47 def fetch(self, possibly_batched_index):
48 if self.auto_collation:
---> 49 data = [self.dataset[idx] for idx in possibly_batched_index]
50 else:
51 data = self.dataset[possibly_batched_index]

File C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\torch\utils\data_utils\fetch.py:49, in (.0)
47 def fetch(self, possibly_batched_index):
48 if self.auto_collation:
---> 49 data = [self.dataset[idx] for idx in possibly_batched_index]
50 else:
51 data = self.dataset[possibly_batched_index]

File C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\torchvision\datasets\ucf101.py:120, in UCF101.getitem(self, idx)
119 def getitem(self, idx: int) -> Tuple[Tensor, Tensor, int]:
--> 120 video, audio, info, video_idx = self.video_clips.get_clip(idx)
121 label = self.samples[self.indices[video_idx]][1]
123 if self.transform is not None:

File C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\torchvision\datasets\video_utils.py:367, in VideoClips.get_clip(self, idx)
365 video = video[resampling_idx]
366 info["video_fps"] = self.frame_rate
--> 367 assert len(video) == self.num_frames, f"{video.shape} x {self.num_frames}"
368 return video, audio, info, video_idx

AssertionError: torch.Size([17, 240, 320, 3]) x 16

I don't know what the problem is.

I'm a beginner in deep learning.

Please help me.

Thank you.

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