crnn-lid icon indicating copy to clipboard operation
crnn-lid copied to clipboard

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

Open Bini55 opened this issue 4 years ago • 11 comments

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

Bini55 avatar Apr 05 '20 19:04 Bini55

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

Bartzi avatar Apr 08 '20 15:04 Bartzi

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 .

Bini55 avatar Apr 09 '20 12:04 Bini55

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.

Bartzi avatar Apr 09 '20 14:04 Bartzi

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

Bini55 avatar Apr 13 '20 07:04 Bini55

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.

Bartzi avatar Apr 16 '20 08:04 Bartzi

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?

Bini55 avatar Apr 20 '20 12:04 Bini55

did you adapt your config accordingly?

Bartzi avatar Apr 22 '20 14:04 Bartzi

yes...

Bini55 avatar Apr 24 '20 15:04 Bini55

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 avatar Apr 24 '20 15:04 Bini55

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..

Bini55 avatar Apr 25 '20 19:04 Bini55

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.

nikhil031294 avatar Jun 14 '20 12:06 nikhil031294