numba's DTW segfaults on NaN similarity
See original GitHub issueDescription
The example code plot_music_sync.py from https://librosa.github.io/librosa/auto_examples/plot_music_sync.html#sphx-glr-download-auto-examples-plot-music-sync-py runs fine with sir_duke_fast.mp3 and sir_duke_slow.mp3. But encounter segmentation fault when using other mp3 files.
Steps/Code to Reproduce
- Replace
x_1, fs = librosa.load('audio/sir_duke_fast.mp3')
to
x_1, fs = librosa.load('audio/BFJazz_-_Stargazer_from_Texas.mp3')
in plot_music_sync.py.
-
Run plot_music_sync.py again and segmentation fault occurs.
-
The exception seems to be thrown from this line:
D, wp = librosa.sequence.dtw(X=x_1_chroma, Y=x_2_chroma, metric='cosine')
Expected Results
Python should exit without Segmentation fault: 11
Actual Results
/Users/igneus/.pyenv/versions/3.7.4/lib/python3.7/site-packages/librosa/core/audio.py:146: UserWarning: PySoundFile failed. Trying audioread instead. warnings.warn(‘PySoundFile failed. Trying audioread instead.’) /Users/igneus/.pyenv/versions/3.7.4/lib/python3.7/site-packages/librosa/core/audio.py:146: UserWarning: PySoundFile failed. Trying audioread instead. warnings.warn(‘PySoundFile failed. Trying audioread instead.’) Segmentation fault: 11
Versions
Darwin-19.0.0-x86_64-i386-64bit Python 3.7.4 (default, Sep 26 2019, 17:15:53) [Clang 10.0.1 (clang-1001.0.46.4)] NumPy 1.17.3 SciPy 1.3.1 librosa 0.7.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:23 (15 by maintainers)
Top GitHub Comments
The same happens with ‘braycurtis’
I converted the mp3 files to wav, and removed all plotting code. But the same segmentation error is still thrown from the dtw line.
Now the code is very simple: