3D-ResNets-PyTorch
3D-ResNets-PyTorch copied to clipboard
Prepare data for other dataset
Have a problem preparing data for other datasets. I tried to convert videos into frames and file structure the same as kinetics dataset. It works well when loading dataset but there is an error in train_epoch.
Traceback (most recent call last):
File "main.py", line 137, in <module>
train_logger, train_batch_logger)
File "/home/jaspr/Dev/3D-ResNets-PyTorch/train.py", line 22, in train_epoch
for i, (inputs, targets) in enumerate(data_loader):
File "/home/jaspr/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 336, in __next__
return self._process_next_batch(batch)
File "/home/jaspr/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 357, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
RuntimeError: Traceback (most recent call last):
File "/home/jaspr/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 106, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/jaspr/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 106, in <listcomp>
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/jaspr/Dev/3D-ResNets-PyTorch/datasets/kinetics.py", line 192, in __getitem__
clip = torch.stack(clip, 0).permute(1, 0, 2, 3)
RuntimeError: expected a non-empty list of Tensors
I think it may be relative to the dataset iteration. How to avoid this error and correctly setup training data for other datasets?
It means your "dataset.py" is not correct which leads to the error of dataloader. Because the form of your data is not the same as this code. If you can't figure out where goes wrong, it would be a choice to debug your code.
How did you solve it? Thank you!