librosa MemoryError
See original GitHub issueI keep getting a MemoryError from librosa
$ python train.py --checkpoint_every=1 --data_dir=data
Using default logdir: ./logdir/train/2016-11-05T21-43-34
Trying to restore saved checkpoints from ./logdir/train/2016-11-05T21-43-34 ... No checkpoint found.
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/neural-network/tensorflow-wavenet/wavenet/audio_reader.py", line 91, in thread_main
for audio, filename in iterator:
File "/home/neural-network/tensorflow-wavenet/wavenet/audio_reader.py", line 24, in load_generic_audio
audio, _ = librosa.load(filename, sr=sample_rate, mono=True)
File "/usr/local/lib/python2.7/dist-packages/librosa/core/audio.py", line 149, in load
y = np.concatenate(y)
MemoryError
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Librosa Memory Error
I'm using librosa's beat_track function to detect the times of beats in a wav file for a game in Pygame. However, when I...
Read more >Python raises Memory Error despite of 16gb Swap
I'm getting MemoryError while running some large matrix operations (chroma, cqt, mfcc extraction) with numpy (1.81), scipy (0.17.0), librosa ...
Read more >GPU memory error when trying to fine tune the whisper ...
I'm trying to fine tune the whisper model with a custom data set but I'm getting a memory error. numpy.core._exceptions.
Read more >Troubleshooting — librosa 0.10.0.dev0 documentation
If you have questions about how to use librosa, please consult the discussion forum. For bug reports and other, more technical issues, consult...
Read more >python 3 - librosa on a raspberry pi
I have a problem with librosa installation on raspberry pi. I followed the instructions from the comment @Austin from: Unable to pip install ......
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
Looks like you need to either reduce memory consumption, or run on a machine with more memory (either host memory, GPU memory or both).
You can set sample_size (which defaults to 100000). If you set sample_size to, say 64000, then instead of having a [1,100000,512] tensor you’d get a [1,64000,512].
[threadjacking thanks to @Cortexelus]
If your input data is in a format supported by libsndfile (eg, flac/wav/ogg but not mp3), I’d recommend using soundfile instead of
librosa.load
(which sits on top ofaudioread
).librosa’s loader is really intended for short signals, and is not at all optimized for memory usage. I’ve used
soundfile
on long signals (~3hr duration) without a hitch though, and since it provides numpy array views of the data, it should play nicely with everything else.(In case you’re wondering, the main reason we don’t switch librosa over to soundfile instead of audioread is mp3 support.)