librosa becomes slower the longer it runs
See original GitHub issueDescription
My code is basically:
for fn in lots_of_flac_files:
audio, sample_rate = librosa.load(fn, sr=None)
mfccs = librosa.feature.mfcc(
audio, sr=sample_rate,
n_mfcc=40,
hop_length=int(0.01 * sample_rate), n_fft=int(0.025 * sample_rate))
All files are about the same length. I added some simple code to estimate the remaining time. The strange thing is that this estimation did not went down, but went up only in the beginning, i.e. it became slower and slower. How could that be? Also, I noticed that the memory consumption seems to slowly increase all the time.
Expected Results
Every call to load
and mfcc
takes about the same time.
Actual Results
The time to execute load
and mfcc
always increases. (Maybe only one of them; I didn’t tested.)
Versions
>>> import platform; print(platform.platform())
Linux-4.9.0-3-amd64-x86_64-with-debian-9.3
>>> import sys; print("Python", sys.version)
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170118]
>>> import numpy; print("NumPy", numpy.__version__)
NumPy 1.14.1
>>> import scipy; print("SciPy", scipy.__version__)
SciPy 1.0.0
>>> import librosa; print("librosa", librosa.__version__)
librosa 0.6.0
>>>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (5 by maintainers)
Top Results From Across the Web
`import librosa` slow to run at 48 seconds issue - Python 博客
Describe the bug** `import librosa` takes way too long, at 48 seconds. ... Stop the stopwatch when the Python prompt becomes responsive/available again....
Read more >Troubleshooting — librosa 0.10.0.dev0 documentation
If you're trying to run some example code, and encounter the following error message: AttributeError: module 'librosa' has no attribute 'display'.
Read more >Performance issues with libROSA - Google Groups
I am using libROSA from Python 2.7 to detect the BPM of a set of audio tracks. ... each run) quite happily then...
Read more >Multiprocessing Pool slow when calling external module
To investigate what's happening, I run top -H and noticed +60 threads being spawned! That was it. Turns out librosa and dependencies spawn ......
Read more >Why do programs get slower with time? - Johnny's Software Lab
A program that used to run at acceptable speed six months ago, ... we talk about the reasons why software becomes slower as...
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
Well, not totally resolved, but we can say that it is not a librosa bug, so yes, this can be closed.
Because libsndfile does not support mp3 yet. When it does, we’ll switch over.