DAVEISHAN / TCLR

Official code repo for TCLR: Temporal Contrastive Learning for Video Representation [CVIU-2022]
MIT License
32 stars 2 forks source link

RuntimeError: stack expects a non-empty TensorList #5

Open iostreambond opened 1 year ago

iostreambond commented 1 year ago

After configuring the code when I am running it using the command:

python3 complete_retrieval.py --saved_model="../models/model_best_e247_loss_9.7173.pth"

I am getting the following Error

Clip ../data/UCF-101/ShavingBeard/v_ShavingBeard_g05_c06.avi Failed
Traceback (most recent call last):
  File "complete_retrieval.py", line 253, in <module>
    train_classifier(str(run_id), arch, str(saved_model), modes)
  File "complete_retrieval.py", line 132, in train_classifier
    pred_dict, label_dict = val_epoch(len(modes), run_id, epoch, modes[val_iter], skip[val_iter],
  File "complete_retrieval.py", line 20, in val_epoch
    for i, (inputs, label, vid_path, _) in enumerate(data_loader):
  File "/home/multi-sy-15/PycharmProjects/TCLR/venv_tclr/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in __next__
    data = self._next_data()
  File "/home/multi-sy-15/PycharmProjects/TCLR/venv_tclr/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data
    return self._process_data(data)
  File "/home/multi-sy-15/PycharmProjects/TCLR/venv_tclr/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
    data.reraise()
  File "/home/multi-sy-15/PycharmProjects/TCLR/venv_tclr/lib/python3.8/site-packages/torch/_utils.py", line 425, in reraise
    raise self.exc_type(msg)
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/home/multi-sy-15/PycharmProjects/TCLR/venv_tclr/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
    data = fetcher.fetch(index)
  File "/home/multi-sy-15/PycharmProjects/TCLR/venv_tclr/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch
    return self.collate_fn(data)
  File "/home/multi-sy-15/PycharmProjects/TCLR/nn_retrieval/dl_ret.py", line 283, in collate_fn2
    f_clip = torch.stack(f_clip, dim=0)
RuntimeError: stack expects a non-empty TensorList