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

List index out of range #19

Open
AshleighHazel opened this issue Jul 19, 2021 · 2 comments
Open

List index out of range #19

AshleighHazel opened this issue Jul 19, 2021 · 2 comments

Comments

@AshleighHazel
Copy link

Hello,
Sorry if this is a naive question very new to python. I'm running the code in a colab note book and I keep getting this error for the train.py script

Traceback (most recent call last):
File "train.py", line 335, in
main()
File "train.py", line 257, in main
samples0, _ = librosa.load(train_split[0], sr=None, mono=True)
IndexError: list index out of range

I'm using all default parameters.

Thanks
Ash

@relativeflux
Copy link
Member

relativeflux commented Jul 19, 2021

@AshleighHazel Hi there, thanks for getting in touch. This looks like a problem with your dataset, either its contents or the location you're passing.

So this is basically the kind of thing that's happening:

>>> train_split = []
>>> train_split[0]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IndexError: list index out of range

So the train_split list is empty, whereas it should be a list of strings, each one denoting the path to an audio chunk in your dataset. Your dataset should be a folder of audio chunks, prepared using the chunk_audio.py script (technically you don't need to use that script, as long as you have a folder of audio chunks of equal length that will be fine). Typically I work with 8 second chunks, at 16kHz sample rate (can be mono or stereo, but everything is converted to mono during training).

Or perhaps the issue is the location of the dataset. Are you sure you're passing the right path, via the --data_dir param to train.py?

@AshleighHazel
Copy link
Author

@relativeflux Thanks so much for your response, it seems like my data set was just too small for the parameters I was using, I uploaded a longer audio file and it is working now. Thanks for pointing me in the right direction and for the code, loving the results!

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