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

numpy.AxisError: axis 1 is out of bounds for array of dimension 1 #18

Open
Bini55 opened this issue Apr 5, 2020 · 11 comments
Open

numpy.AxisError: axis 1 is out of bounds for array of dimension 1 #18

Bini55 opened this issue Apr 5, 2020 · 11 comments

Comments

@Bini55
Copy link

Bini55 commented Apr 5, 2020

While running the evaluate.py code I'm getting the following error. I'm using ubuntu (18.04) terminal

Traceback (most recent call last):
File "evaluate.py", line 66, in
evaluate(cli_args)
File "evaluate.py", line 53, in evaluate
y_pred = np.argmax(probabilities, axis=1)
File "<array_function internals>", line 6, in argmax
File "/home/bini/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 1153, in argmax
return _wrapfunc(a, 'argmax', axis=axis, out=out)
File "/home/bini/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 58, in _wrapfunc
return _wrapit(obj, method, *args, **kwds)
File "/home/bini/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 47, in _wrapit
result = getattr(asarray(obj), method)(*args, **kwds)
numpy.AxisError: axis 1 is out of bounds for array of dimension 1

@Bartzi
Copy link
Member

Bartzi commented Apr 8, 2020

Hmm, difficult to tell what's wrong. What did you do exactly?

@Bini55
Copy link
Author

Bini55 commented Apr 9, 2020

I trained the network using train.py and saved the weight model ,also predicted an audio file .But when I'm trying to run the evaluate code the above error is showing .I don't understand what's wrong .

@Bartzi
Copy link
Member

Bartzi commented Apr 9, 2020

I also don't know what's wrong. I can only advise you to do some debugging and determine why the array probabilities seems to have only one axis instead of the expected two axes.

@Bini55
Copy link
Author

Bini55 commented Apr 13, 2020

Mmmm....When I check shape of probabilities using np.shape(probabilities) it gives (0,) .

@Bartzi
Copy link
Member

Bartzi commented Apr 16, 2020

Seems, that your model does not return any predictions. You could check that your are using the correct model and that your model gets some input at all.

@Bini55
Copy link
Author

Bini55 commented Apr 20, 2020

I found that it's not loading test_data_dir in to the evaluate.py....no issues with the validation_data_dir .Can you please help me to solve this issue?

@Bartzi
Copy link
Member

Bartzi commented Apr 22, 2020

did you adapt your config accordingly?

@Bini55
Copy link
Author

Bini55 commented Apr 24, 2020

yes...

@Bini55
Copy link
Author

Bini55 commented Apr 24, 2020

I have another doubt...If we trying to normalize the audio loudness using neg23.py (which is in tools folder) is it change the duration of the audio files? Because when I'm trying to normalize my audio files of duration 10sec each using neg23.py after running the code the duration of each audio files changes to 6sec. I have no idea whats happening ....Can you please tell where I should change so that I could get audio files of duration 10sec.

@Bini55
Copy link
Author

Bini55 commented Apr 25, 2020

Can you please share me what is the purpose of loudness normalization in this language identification task or why we use it?What happens if we skip that step? (advantage and disadvantage of using loudness normalization) ...I don't have any idea about it that's why..._

Actually when I tried to obtain spectrogram of audio files after normalization and segmentation (first I did normalization and then segmentation) I'm unable to process it ,shows Index error:list index out of range .But when I tried to obtain spectrogram after segmentation and normalization (first I did segmentation and then normalization )I'm able to obtain the spectrogram images....I'm unable find the logic behind that could you please help me..

@nikhil031294
Copy link

Can you check your numpy version once, whether it matches the requirements. If that is correct, try changing the code for evaluating the argmax of the array,which suits your probabilities variable.

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