wswdx/C2F-FWN

IndexError: list index out of range

Closed this issue · 1 comments

Thanks for your great work firstly!

when I run "bash scripts/stage2/train_2.sh", the errors come as below:

2021-02-02T03:36:20.050232142Z Traceback (most recent call last):
2021-02-02T03:36:20.050261277Z File "train_stage2.py", line 148, in
2021-02-02T03:36:20.050276234Z train()
2021-02-02T03:36:20.050280035Z File "train_stage2.py", line 38, in train
2021-02-02T03:36:20.050283718Z for idx, data in enumerate(dataset, start=epoch_iter):
2021-02-02T03:36:20.050287632Z File "/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 637, in next
2021-02-02T03:36:20.050291185Z return self._process_next_batch(batch)
2021-02-02T03:36:20.050307614Z File "/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 658, in _process_next_batch
2021-02-02T03:36:20.050311369Z raise batch.exc_type(batch.exc_msg)
2021-02-02T03:36:20.050314555Z IndexError: Traceback (most recent call last):
2021-02-02T03:36:20.050317753Z File "/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 138, in _worker_loop
2021-02-02T03:36:20.050321226Z samples = collate_fn([dataset[i] for i in batch_indices])
2021-02-02T03:36:20.050324425Z File "/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 138, in
2021-02-02T03:36:20.050327926Z samples = collate_fn([dataset[i] for i in batch_indices])
2021-02-02T03:36:20.050331102Z File "/workspace/cpfs-data/C2F-FWN-main-v1/data/data_stage2.py", line 57, in getitem
2021-02-02T03:36:20.050334599Z sparsing_path = self.sparsing_paths[seq_idx][start_idx + i * t_step]
2021-02-02T03:36:20.050337893Z IndexError: list index out of range

I am looking forward to your reply, thanks!

wswdx commented

Hi. Please ensure the directory that "self.sparsing_paths" point to is valid and contain all the downloaded human parsing files. You can print out len(self.sparsing_paths) and len(self.sparsing_paths[seq_idx] to check whether the number of sequences and human parsing files is correct, respectively.