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

Getting IndexError while Training or Inference #10

Closed
Aayush2007 opened this issue Feb 1, 2022 · 1 comment
Closed

Getting IndexError while Training or Inference #10

Aayush2007 opened this issue Feb 1, 2022 · 1 comment

Comments

@Aayush2007
Copy link

This is the command I use: !python main.py --work-dir results --device 0 --num-worker 4 --batch-size 1

Here is the error that I get:
Traceback (most recent call last):
File "main.py", line 219, in
processor.start()
File "main.py", line 46, in start
self.device, epoch, self.recoder)
File "/home/jupyter/VAC_CSLR/seq_scripts.py", line 21, in seq_train
for batch_idx, data in enumerate(loader):
File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 521, in next
data = self._next_data()
File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data
return self._process_data(data)
File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
data.reraise()
File "/opt/conda/lib/python3.7/site-packages/torch/_utils.py", line 434, in reraise
raise exception
IndexError: Caught IndexError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/jupyter/VAC_CSLR/dataset/dataloader_video.py", line 47, in getitem
input_data, label = self.normalize(input_data, label)
File "/home/jupyter/VAC_CSLR/dataset/dataloader_video.py", line 78, in normalize
video, label = self.data_aug(video, label, file_id)
File "/home/jupyter/VAC_CSLR/utils/video_augmentation.py", line 24, in call
image = t(image)
File "/home/jupyter/VAC_CSLR/utils/video_augmentation.py", line 119, in call
if isinstance(clip[0], np.ndarray):
IndexError: list index out of range

Can you tell me what am I doing wrong?

@Aayush2007 Aayush2007 changed the title Getting IndexError while training Getting IndexError while Training or Inference Feb 1, 2022
@sunsn1997
Copy link

hello,How did you solve this problem

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

2 participants