janclemenslab / das

Deep Audio Segmenter
http://janclemenslab.org/das/
27 stars 10 forks source link

Index error when predicting: index 0 is out of bounds for axis 0 with size 0 #41

Closed chitayata closed 2 years ago

chitayata commented 2 years ago

Dear Jan and team,

I am using the DAS GUI and working through the tutorial but I keep running into the same error when I try to predict.

INFO:root:Predicting song using DAS: INFO:root: Running inference on audio. INFO:root: Model from C:/Users/chita/OneDrive/Desktop/Chimp_vocalizations/Quickstart.res/20220819_125409. 40/40 [==============================] - 2s 34ms/step Traceback (most recent call last): File "C:\Users\chita\miniconda3\envs\das\lib\site-packages\xarray_behave\gui\app.py", line 1809, in menuitem.triggered.connect(lambda: callback(qt_keycode)) File "C:\Users\chita\miniconda3\envs\das\lib\site-packages\xarray_behave\gui\app.py", line 709, in daspredict events, segments, , _ = das.predict.predict( File "C:\Users\chita\miniconda3\envs\das\lib\site-packages\das\predict.py", line 353, in predict events, segments = predict_song(class_probabilities=class_probabilities, params=params, File "C:\Users\chita\miniconda3\envs\das\lib\site-packages\das\predict.py", line 242, in predict_song events = predict_events(class_probabilities, samplerate, File "C:\Users\chita\miniconda3\envs\das\lib\site-packages\das\predict.py", line 212, in predict_events good_event_indices = event_utils.event_interval_filter(events_seconds, File "C:\Users\chita\miniconda3\envs\das\lib\site-packages\das\event_utils.py", line 109, in event_interval_filter ipi_too_short[0] = False # otherwise first event will always be removed IndexError: index 0 is out of bounds for axis 0 with size 0

I have tried this many times with the Drosophila dataset, as well as my own, but this doesn't make a difference. A couple of times (but not every time) when I checked the box for 'Training targets for individual song times' when doing 'DAS/Make dataset for training', I was able to run the model to make predictions without getting the above error. However, I don't think it worked as it is supposed to because there were very few proposals made. Even the pulse song came back with only 2-3 proposals.

Any insight is greatly appreciated! Thank you.

postpop commented 2 years ago

Hi, this error looks familiar - I think we fixed it in one of the latest releases. Can you upgrade to the latest version (0.26.9) with pip install das --upgrade --no-deps and let me know if the problem persists?

chitayata commented 2 years ago

Great, it worked! No more error, and it seems to be making predictions appropriately. I'm happy it was an easy fix. Many many thanks.

postpop commented 2 years ago

Happy this worked! I'm closing the issue.