MTG / essentia

C++ library for audio and music analysis, description and synthesis, including Python bindings
http://essentia.upf.edu
GNU Affero General Public License v3.0
2.81k stars 525 forks source link

RuntimeError: Error while configuring MonoLoader: AudioLoader: Could not open file "genres/disco/disco.00058.au", error = Too many open files #630

Open nagamanojk opened 7 years ago

nagamanojk commented 7 years ago

Hi, I'm trying the following loader = ess.MonoLoader()

for aFilename in files: //for 1000 files loader.configure(filename = aFilename, sampleRate = fs) audio = loader()

I'm getting the following error, just for 1000 files, but I'm planning to use the same for a much bigger dataset for my experiment, is there any fix for this issue.

RuntimeError Traceback (most recent call last) /home/nagamanoj/sms-tools-master/expt.py in ()

/home/nagamanoj/sms-tools-master/expt.py in myMfcc(aCsvfile, aFilename, sampleRate)

/usr/local/lib/python2.7/dist-packages/essentia/standard.py in configure(self, **kwargs)

RuntimeError: Error while configuring MonoLoader: AudioLoader: Could not open file "genres/jazz/jazz.00052.au", error = Too many open files

Thanks

nagamanojk commented 7 years ago

@dbogdanov

There is no issue with this code for i in range(1,1000): cnt = cnt+1 print cnt audio = ess.AudioLoader(filename = 'genres/jazz/jazz.00032.au')

But the issue is reproduceable with the below code for i in range(1,1000): cnt = cnt+1 print cnt audio = ess.MonoLoader(filename = 'genres/jazz/jazz.00032.au', sampleRate = fs)()

505 506 507 508 509

RuntimeError Traceback (most recent call last) /home/nagamanoj/sms-tools-master/monoBug.py in ()

/usr/local/lib/python2.7/dist-packages/essentia/standard.py in init(self, **kwargs)

/usr/local/lib/python2.7/dist-packages/essentia/standard.py in configure(self, **kwargs)

RuntimeError: Error while configuring MonoLoader: AudioLoader: Could not open file "genres/jazz/jazz.00032.au", error = Too many open files

jamiebullock commented 7 years ago

The problem is that the *Loader classes are not closing files. I propose a workaround in #631 (bottom of issue) if you are interested.

carthach commented 7 years ago

Also running into this issue.

alastair commented 6 years ago

Would be nice to fix this for 2.1