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 #16

Closed
evialv opened this issue Jun 28, 2021 · 4 comments
Closed

IndexError: list index out of range #16

evialv opened this issue Jun 28, 2021 · 4 comments

Comments

@evialv
Copy link

evialv commented Jun 28, 2021

Hi,
I'm trying to compile main and I get the IndexError.
My datasets folder consists of only the ABOUT folder(npz format) due to memory restrictions and my labels folder only the txt provided with only the ABOUT word inside. I try to compile and get the following error. I tried to figure it out with debugging but no luck. Have you faced an issue like this one before?

Thank you

To be more specific :

Model and log being saved in: D:\new_lipreading\Lipreading_using_Temporal_Convolutional_Networks\train_logs\tcn
Traceback (most recent call last):
File "D:/new_lipreading/Lipreading_using_Temporal_Convolutional_Networks/main.py", line 260, in
main()
File "D:/new_lipreading/Lipreading_using_Temporal_Convolutional_Networks/main.py", line 202, in main
dset_loaders = get_data_loaders(args)
File "D:\new_lipreading\Lipreading_using_Temporal_Convolutional_Networks\lipreading\dataloaders.py", line 52, in get_data_loaders
) for partition in ['train', 'val', 'test']}
File "D:\new_lipreading\Lipreading_using_Temporal_Convolutional_Networks\lipreading\dataloaders.py", line 52, in
) for partition in ['train', 'val', 'test']}
File "D:\new_lipreading\Lipreading_using_Temporal_Convolutional_Networks\lipreading\dataset.py", line 30, in init
self.load_dataset()
File "D:\new_lipreading\Lipreading_using_Temporal_Convolutional_Networks\lipreading\dataset.py", line 39, in load_dataset
self._get_files_for_partition()
File "D:\new_lipreading\Lipreading_using_Temporal_Convolutional_Networks\lipreading\dataset.py", line 76, in _get_files_for_partition
self._data_files = [ f for f in self._data_files if f.split('/')[self.label_idx] in self._labels ]
File "D:\new_lipreading\Lipreading_using_Temporal_Convolutional_Networks\lipreading\dataset.py", line 76, in
self._data_files = [ f for f in self._data_files if f.split('/')[self.label_idx] in self._labels ]
IndexError: list index out of range

Process finished with exit code 1

@mpc001
Copy link
Owner

mpc001 commented Jun 28, 2021

Hi,

thanks for your interests!

At file "D:\new_lipreading\Lipreading_using_Temporal_Convolutional_Networks\lipreading\dataset.py", can you try to change the path separator / need change to \ to see if it works?

@evialv
Copy link
Author

evialv commented Jun 29, 2021

Hello,

Thank you for your response, unfortunately the path to dataset.py is automatically generated via the import in the main.py file ---> from lipreading.dataloaders import get_data_loaders, get_preprocessing_pipelines since these functions belong to dataset.py so I didn't hardcode the path to the file anywhere

@mpc001
Copy link
Owner

mpc001 commented Jun 29, 2021

Hi,

At line 76, I split the path to get the filename. I assume you are parsing a Windows path, where the pathnames are formatted differently from Unix. It seems that no item could be matched to the list self._labels. Can you please check it?

@evialv
Copy link
Author

evialv commented Jun 30, 2021

Great! Yes the path splitting was the issue (replaced / with \ since as you mentioned paths are different in Windows).
Thank you for your help

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

2 participants