mir-aidj / all-in-one

All-In-One Music Structure Analyzer
http://arxiv.org/abs/2307.16425
MIT License
370 stars 35 forks source link

IndexError: index 0 is out of bounds for axis 0 with size 0 #4

Closed igoralvarezz closed 9 months ago

igoralvarezz commented 9 months ago

Hi, I'm currently running all-in-one on Ubuntu using WSL for Windows (because I wasn't able to compile Natten from source to run it natively. I was analyzing some songs and it worked out fine until I faced the following error:


Analyzing 02 - Genesis.mp3:  30%|████████████████▏                                     | 72/241 [05:07<12:02,  4.28s/it]
Traceback (most recent call last):
  File "bin/allin1", line 8, in <module>
    sys.exit(main())
  File "lib/python3.9/site-packages/allin1/cli.py", line 49, in main
    analyze(
  File "lib/python3.9/site-packages/allin1/analyze.py", line 114, in analyze
    bpm = estimate_tempo_from_beats(metrical_structure['beats'])
  File "lib/python3.9/site-packages/allin1/postprocessing/tempo.py", line 19, in estimate_tempo_from_beats
    bpm_est = bpm_cand[0, 0]
IndexError: index 0 is out of bounds for axis 0 with size 0```
tae-jun commented 9 months ago

Hmm I'm not sure if it's due to WSL.

But I can't imagine in which case bpm_cand has zero entry.

Could you send the audio file to my Gmail if it's possible?

I will run the analysis on my side.

igoralvarezz commented 9 months ago

I just sent you an example via email, sorry for the delay. I was testing to see if it was something related to WSL by installing it in a real Linux environment (Debian 12, no VM, no WSL) and the issue persisted with the same error message. Out of ~ 550 tracks I tested on, only 3 of them presented the same error, the remaining ones were successfully analyzed.

tae-jun commented 9 months ago

I listened to it and tested it, and it turns out there are no detected beats.

Since the model has a thresholding mechanism, there might be no beat if the percussive pulse isn't strong enough.

However, I still believe this is a bug, and I should implement logic for this scenario.

I think I'll set the BPM to null in such cases.

I will fix it and release the next version.

Thanks for your report!

But I guess there would be no useful output from the model for such audio files even though it's fixed...🥲

igoralvarezz commented 9 months ago

Yes, I guess it makes sense. Avoiding the type error and stating that there was no detectable BPM seems to be the right option. Maybe a try/except for IndexError with a print message could do it?

Em dom., 1 de out. de 2023 às 08:09, Taejun Kim @.***> escreveu:

I listened to it and tested it, and it turns out there are no detected beats.

Since the model has a thresholding mechanism, there might be no beat if the percussive pulse isn't strong enough.

However, I still believe this is a bug, and I should implement logic for this scenario.

I think I'll set the BPM to null in such cases.

I will fix it and release the next version.

Thanks for your report!

But I guess there would be no useful output from the model for such audio files even though it's fixed...🥲

— Reply to this email directly, view it on GitHub https://github.com/mir-aidj/all-in-one/issues/4#issuecomment-1742045584, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUFBFMHBQ6HAOHLTSKQLUCLX5FFP5ANCNFSM6AAAAAA5BUBAVM . You are receiving this because you authored the thread.Message ID: @.***>

tae-jun commented 9 months ago

Thanks for the suggestion!

I just released v1.0.1 and it should be fixed in this new release.

Please reopen this issue if you still get the same error.