Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: list index out of range #46

Open
rebecca0011 opened this issue Nov 26, 2021 · 2 comments
Open

IndexError: list index out of range #46

rebecca0011 opened this issue Nov 26, 2021 · 2 comments

Comments

@rebecca0011
Copy link

rebecca0011 commented Nov 26, 2021

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

pixel_error 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
Copy link
Owner

mli0603 commented Nov 29, 2021

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
Copy link
Contributor

DeH40 commented Jan 6, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants