mli0603 / stereo-transformer

Revisiting Stereo Depth Estimation From a Sequence-to-Sequence Perspective with Transformers. (ICCV 2021 Oral)
Apache License 2.0
659 stars 106 forks source link

IndexError: list index out of range #46

Open rebecca0011 opened 2 years ago

rebecca0011 commented 2 years ago

Thanks for your code but I got an index error ....I don't know how to deal with.....

pixelerror 0.944978416022389 0%|▏ | 16/22390 [00:22<8:50:24, 1.42s/it] Traceback (most recent call last): File "main.py", line 250, in main(args) File "main.py", line 221, in main args.clip_max_norm, amp) File "/home/rc/StereoMatching/stereo-transformer/utilities/train.py", line 30, in train_one_epoch for idx, data in enumerate(tbar): File "/home/rc/anaconda3/envs/DL/lib/python3.7/site-packages/tqdm/std.py", line 1180, in iter for obj in iterable: File "/home/rc/anaconda3/envs/DL/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 517, in next data = self._next_data() File "/home/rc/anaconda3/envs/DL/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1199, in _next_data return self._process_data(data) File "/home/rc/anaconda3/envs/DL/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1225, in _process_data data.reraise() File "/home/rc/anaconda3/envs/DL/lib/python3.7/site-packages/torch/_utils.py", line 429, in reraise raise self.exc_type(msg) IndexError: Caught IndexError in DataLoader worker process 0. Original Traceback (most recent call last): File "/home/rc/anaconda3/envs/DL/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 202, in _worker_loop data = fetcher.fetch(index) File "/home/rc/anaconda3/envs/DL/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/rc/anaconda3/envs/DL/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/rc/StereoMatching/stereo-transformer/dataset/scene_flow.py", line 129, in getitem occ_right_fname = self.occ_data[idx].replace('left', 'right') IndexError: list index out of range

my dataset is like this :

Dataset

Scene_flow

disparity

TRAIN

A(from sceneflow frames_disparity/TRAIN/A) B(from sceneflow frames_disparity/TRAIN/B) C(from sceneflow frames_disparity/TRAIN/C)

TEST.....

frame_finalpass

TRAIN

A(from sceneflow frames_finalpass/TRAIN/A) B(from sceneflow frames_finalpass/TRAIN/B) C(from sceneflow frames_finalpass/TRAIN/C)

TEST.....

occlusion

TRAIN

left(from sceneflow FlyingThings3D_subset/train/disparity_occlusions/left) right(from sceneflow FlyingThings3D_subset/train/disparity_occlusions/right)

TEST

left(from sceneflow FlyingThings3D_subset/val/disparity_occlusions/left) right(from sceneflow FlyingThings3D_subset/val/disparity_occlusions/right)

mli0603 commented 2 years ago

Hi @rebecca0011

Your folde structure seems right to me. Looking at the log the occlusion data was not loaded properly. Do you mind checking?

DeH40 commented 2 years ago

Hi @rebecca0011 @mli0603 ,I encountered the same issue as @rebecca0011 before, I used utilities/subsample_sceneflow.py to process the dataset and the issue was solved, I hope to help you