`import librosa` slow to run at 48 seconds
See original GitHub issueDescribe the bug
import librosa
takes way too long, at 48 seconds.
To Reproduce
import librosa
# Start a stopwatch to time it.
# Stop the stopwatch when the Python prompt becomes responsive/available again.
# In my case, it takes 48 seconds.
Expected behavior Would expect it to go fast.
Software versions
Python 3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform; print(platform.platform())
Linux-5.10.104-linuxkit-x86_64-with-glibc2.29
>>> import sys; print("Python", sys.version)
Python 3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 9.4.0]
>>> import numpy; print("NumPy", numpy.__version__)
NumPy 1.22.4
>>> import scipy; print("SciPy", scipy.__version__)
SciPy 1.8.1
>>> import librosa; print("librosa", librosa.__version__)
librosa 0.9.2
>>> librosa.show_versions()
INSTALLED VERSIONS
------------------
python: 3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 9.4.0]
librosa: 0.9.2
audioread: 2.1.9
numpy: 1.22.4
scipy: 1.8.1
sklearn: 1.1.1
joblib: 1.1.0
decorator: 5.1.1
soundfile: 0.10.3
resampy: 0.3.1
numba: 0.55.2
pooch: v1.6.0
packaging: 21.3
numpydoc: None
sphinx: None
sphinx_rtd_theme: None
sphinx_multiversion: None
sphinx_gallery: None
mir_eval: None
ipython: None
sphinxcontrib-svg2pdfconverter: None
pytest: None
pytest-mpl: None
pytest-cov: None
matplotlib: None
samplerate: None
soxr: None
contextlib2: None
presets: None
System:
- I’m running things inside of a Docker container running
heroku/heroku:20
(based off Ubuntu 20).- If I run
import librosa
from the host computer running macOS the speed is normal. - The Mac is a 2021 MacBook Pro M1.
- If I run
Additional context
What I’ve tried:
- Restarting my Docker container;
- Uninstalling / Reinstalling librosa
There’s no error message in the prompt. Where could I look for additional information? (Say logs, or how to run libsndfile or other from the command-line?)
Issue Analytics
- State:
- Created a year ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
librosa becomes slower the longer it runs · Issue #681 - GitHub
The time to execute load and mfcc always increases. (Maybe only one of them; I didn't tested.) Versions. >>> import platform; print(platform.
Read more >Reading a wav file with scipy and librosa in python
I do find strange though that the librosa. load() function offers a dtype parameter but works anyways only with float values. Googling in...
Read more >librosa.load — librosa 0.10.0.dev0 documentation
Load an audio file as a floating point time series. Audio will be automatically resampled to the given rate (default sr=22050 ). To...
Read more >Parallelized Spectrogram as numpy - Kaggle
If audio is less than 5 seconds first, then it is assumed to have a bird call (so no_call cannot be there) and...
Read more >Comparing Signals
First, from within Notebook, you can execute the following two lines within a cell (you'll only need to run this once): import sys...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This will be resolved with the 0.4 release of resampy next week, and requires no further action from the librosa side.
Found the culprit: it’s indeed
resampy
.