OverLordGoldDragon / ssqueezepy

Synchrosqueezing, wavelet transforms, and time-frequency analysis in Python
MIT License
647 stars 95 forks source link

running out of memory with wav audio file #80

Closed journeytosilius closed 2 years ago

journeytosilius commented 2 years ago

trying to run with this file :

Channels: 2
Sample width: 2
Frame rate (sample rate): 48000
Frame width: 4
Length (ms): 115136
Frame count: 5526528.0

it's a 22MB wav file

first I load the file with librosa :

#load file with librosa
x, sr = librosa.load(file)

Tx, Wx, ssq_freqs, scales, *_ = ssq_cwt(x, nv=16, wavelet='morlet', astensor=True, cache_wavelet=True)

RuntimeError: CUDA out of memory. Tried to allocate 2.53 GiB (GPU 0; 7.79 GiB total capacity; 5.76 GiB already allocated; 947.44 MiB free; 5.76 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

I checked nvidia-smi and yes it starts taking memory until it reaches the mem limit, then it releases when it crashes

is there any trick to analyze such files without hitting the memory limits ? Thanks