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

Error: return int(self._data[1]) IndexError: list index out of range #116

Closed
yhc1994 opened this issue Sep 6, 2020 · 0 comments
Closed

Comments

@yhc1994
Copy link

yhc1994 commented Sep 6, 2020

Hi,

I have edited my list file under the for mat video_frame_path 100 10
But I will get a new error immediately after epoch 4.
It will return int(self._data[1]) IndexError rather than self._data[2]
The code is attached.

clipping gradient: 45.87702178955078 with coef 0.43594807386398315
Freezing BatchNorm2D except the first one.
Traceback (most recent call last):
File "main.py", line 301, in
main()
File "main.py", line 128, in main
prec1 = validate(val_loader, model, criterion, (epoch + 1) * len(train_loader))
File "main.py", line 213, in validate
for i, (input, target) in enumerate(val_loader):
File "D:\Anaconda3\envs\dissertation\lib\site-packages\torch\utils\data\dataloader.py", line 286, in next
return self._process_next_batch(batch)
File "D:\Anaconda3\envs\dissertation\lib\site-packages\torch\utils\data\dataloader.py", line 307, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
IndexError: Traceback (most recent call last):
File "D:\Anaconda3\envs\dissertation\lib\site-packages\torch\utils\data\dataloader.py", line 57, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "D:\Anaconda3\envs\dissertation\lib\site-packages\torch\utils\data\dataloader.py", line 57, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "D:\Developments\Dissertation\tsn-pytorch\dataset.py", line 95, in getitem
segment_indices = self._sample_indices(record) if self.random_shift else self._get_val_indices(record)
File "D:\Developments\Dissertation\tsn-pytorch\dataset.py", line 76, in _get_val_indices
if record.num_frames > self.num_segments + self.new_length - 1:
File "D:\Developments\Dissertation\tsn-pytorch\dataset.py", line 19, in num_frames
return int(self._data[1])
IndexError: list index out of range

@yhc1994 yhc1994 closed this as completed Sep 6, 2020
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