Action-Recognition icon indicating copy to clipboard operation
Action-Recognition copied to clipboard

list index out of range when start training

Open nicholasguimaraes opened this issue 5 years ago • 1 comments

Hello, I'm trying to start training with the UCF-101 dataset.

I've done a few adaptations on your code to get where I am now.

I downloaded the ucf 101 dataset in .avi. I then extracted all of the frames using extract_frames.py

After, I downloaded the train and test split files for the dataset from here ,

https://github.com/yjxiong/temporal-segment-networks/issues/177

for the split_path argument I'm passing the path to the folder ( named ucfTrainTestlist ) containing classInd.txt , testlist01.txt , trainlist01.txt

Here are the args im passing to start traning:

python train.py --dataset_path data/frames/-frames/data/frames --split_path ucfTrainTestlist/ --split_number 1

and here is the error I'm getting:

--- Epoch 0 --- Traceback (most recent call last): File "train.py", line 115, in for batch_i, (X, y) in enumerate(train_dataloader): File "C:\Users\Windows\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 819, in next return self._process_data(data) File "C:\Users\Windows\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 846, in _process_data data.reraise() File "C:\Users\Windows\Anaconda3\lib\site-packages\torch_utils.py", line 369, in reraise raise self.exc_type(msg) IndexError: Caught IndexError in DataLoader worker process 0. Original Traceback (most recent call last): File "C:\Users\Windows\Anaconda3\lib\site-packages\torch\utils\data_utils\worker.py", line 178, in _worker_loop data = fetcher.fetch(index) File "C:\Users\Windows\Anaconda3\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\Users\Windows\Anaconda3\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\Users\Windows\Documents\Action-Recognition\dataset.py", line 78, in getitem image_paths = self._pad_to_length(image_paths) File "C:\Users\Windows\Documents\Action-Recognition\dataset.py", line 67, in _pad_to_length left_pad = sequence[0] IndexError: list index out of range

I point the dataset_path to the folder called frames and inside this folder the video frames are divided in sub folders. These sub folders are named after the names of each video.

nicholasguimaraes avatar Dec 16 '19 22:12 nicholasguimaraes

please check if there is no frame after extract_frames.py

pcshih avatar Jan 13 '20 02:01 pcshih