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
Support for librosa needed #2418
Comments
When trying to reproduce this, I didn't go with Anaconda, to not see its specific problem immediately. I noticed that I believe |
So, librosa is using numba for parts, but rather unconditionally, and with decorators that will crash. I managed to do the Not sure when I get to add that. I will try for 1.9, since that will be simple to do and might remove a lot of bloat for cases of hard importing numba. What Nuitka recommends, namely to just not include it, will just give an ImportError during startup when librosa is importing the |
Hello Kay, |
So, current factory will do librosa lazy loader just fine, and actually pretty efficient. I have yet to check if now skimage and sklearn work as well. However, the numba angle is unresolved. That stub module replacement for numba would probably do a good job and get a large subset of librosa to work, hard to tell now. For now it will be more of a priority to get that mechanism that I added there stabilized, and applied to e.g. the huggingface_hub variation, but I will eventually get to that numba work as well. |
The lazy loader changes are on current develop. Not sure if I can get the numba solution, I am feeling the need to prepare for 3.12 release readiness. |
Part of the 1.9 release I just made. It seems using librosa pulls in numba and the warning, but programs will still work, since it is not used most of the time. |
hello, I still cant sucecess with librosa
Nuitka-Options:INFO: Used command line options: --standalone --onefile tests/test.py
process audio file tests/4sec.wav |
Posting below closed issues is a surefire way to get ignored @wl-junlin |
New issues with pull issue template are expected in case a problem resurfaces. |
Hello,
I compiled some simple scripts that worked (Hello world, playing a clip with librosa, graphing a sine wave with matplotlib & numpy) but the current test to graph a spectrogram with matplotlib and librosa fails. The executable compiles fine but exits without producing the graph I get from the interpreter. This problem is dashing my hopes for a larger project -- any assistance welcome.
Thanks,
Jeff Lawrence
I'm using Windows 10 running under Parallels on a Macbook
Installation:
I used intelliJ IDE package installation feature to install nuitka and all other dependencies in a conda virtualenv. I installed Anaconda python 3.11 using Anaconda's installer package
The specific PyPI names and versions -- I'm sorry, but I don't know how to determine this
relevant output from > python -m pip freeze
...
librosa==0.10.1
...
matplotlib @ file:///C:/b/abs_49b2acwxd4/croot/matplotlib-suite_1679593486357/work
...
Nuitka==1.7.10
...
numpy==1.24.0
...
PyAudio==0.2.13
...
<<are these the PyPl names and versions referred to above? >>
pycparser @ file:///tmp/build/80754af9/pycparser_1636541352034/work
pyparsing @ file:///C:/ci_311/pyparsing_1678502182533/work
PyQt5==5.15.7
PyQt5-sip @ file:///C:/ci_311/pyqt-split_1676428895938/work/pyqt_sip
python-dateutil @ file:///tmp/build/80754af9/python-dateutil_1626374649649/work
Nuitka compile options (these worked fine with prior test examples):
python -m nuitka --enable-plugin=tk-inter --standalone --onefile --disable-console stft_spectralcentroids.py
Example code -- stft_spectralcentroids.py (uses any wave file clip "OneWord.wav"):
import librosa
import librosa.display
import numpy as np
import matplotlib.pyplot as plt
audio_file = "OneWord.wav" # a short voice-audio clip
graph_data, sample_rate = librosa.load(audio_file, sr=48000, mono=True)
plt.figure(figsize=(10, 5))
graph_ax = plt.gca()
spec, phase = librosa.magphase(librosa.stft(y=graph_data))
centroids = librosa.feature.spectral_centroid(S=spec)
times = librosa.times_like(centroids)
librosa.display.specshow(librosa.amplitude_to_db(spec, ref=np.max),
y_axis='log', x_axis='time', ax=graph_ax)
graph_ax.plot(times, centroids[0], label='Spectral centroid', color='w')
plt.show()
The text was updated successfully, but these errors were encountered: