-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Open
Labels
defectA clear bug or issue that prevents SciPy from being installed or used as expectedA clear bug or issue that prevents SciPy from being installed or used as expectedscipy.signal
Description
I have code that resamples many audio files using scipy.signal.resample. The code uses much more memory than I would expect to the point of freezing the OS. I've managed to simplify my code to a simple test case. This uses ~8Gb RAM after about 6 iterations but I would expect it should use much less memory than this.
I am using inputs of varying sizes, which seems to be significant. If I use an audio input of constant size there doesn't seem to be a problem.
from scipy.signal import resample
import numpy as np
def Test():
shps = range(11473744, 1000, -2)
for i, shp in enumerate(shps):
signal = np.random.normal(size=(shp, 1))
print (i, signal.shape)
targetSamples = signal.shape[0]*44100//48000
signal2 = resample(signal, targetSamples, axis=0)
print (signal2.shape)
del signal, signal2
if __name__=="__main__":
Test()
I might have missed something obvious, so this might not even be a bug!
- Scipy 1.4.1
- Numpy 1.18.4
- Python sys.version_info(major=3, minor=6, micro=9, releaselevel='final', serial=0)
Metadata
Metadata
Assignees
Labels
defectA clear bug or issue that prevents SciPy from being installed or used as expectedA clear bug or issue that prevents SciPy from being installed or used as expectedscipy.signal