Python multiprocessing Pool, OSError: Errno 2 No such file or directory
Python multiprocessing Pool, OSError: Errno 2 No such file or directory
我正在尝试使用此 github repo to do some birdsong analysis. I've come across a problem in the stage where I collect all the sample's into one array('Collect Samples'). I'm getting an error that looks to be something to do with my system. Not sure where to start on fixing the error. (have a look at my link to the github 存储库来获得更深入的信息。)感谢您的观看!
def job(fn):
return load_sample(fn, sr=sr,
max_length=max_length, fixed_length=fixed_length)
pool = Pool()
%time results = pool.map(job, files[:limit])
print 'Processed', len(results), 'samples'
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-8-5d12f8de2a12> in <module>()
3 max_length=max_length, fixed_length=fixed_length)
4 pool = Pool()
----> 5 get_ipython().magic(u'time results = pool.map(job, files[:limit])')
6 print 'Processed', len(results), 'samples'
/home/notebook/anaconda2/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
2156 magic_name, _, magic_arg_s = arg_s.partition(' ')
2157 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2158 return self.run_line_magic(magic_name, magic_arg_s)
2159
2160 #-------------------------------------------------------------------------
/home/notebook/anaconda2/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
2077 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2078 with self.builtin_trap:
-> 2079 result = fn(*args,**kwargs)
2080 return result
2081
<decorator-gen-59> in time(self, line, cell, local_ns)
/home/notebook/anaconda2/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
186 # but it's overkill for just that one bit of state.
187 def magic_deco(arg):
--> 188 call = lambda f, *a, **k: f(*a, **k)
189
190 if callable(arg):
/home/notebook/anaconda2/lib/python2.7/site-packages/IPython/core/magics/execution.pyc in time(self, line, cell, local_ns)
1183 else:
1184 st = clock2()
-> 1185 exec(code, glob, local_ns)
1186 end = clock2()
1187 out = None
<timed exec> in <module>()
/home/notebook/anaconda2/lib/python2.7/multiprocessing/pool.pyc in map(self, func, iterable, chunksize)
249 '''
250 assert self._state == RUN
--> 251 return self.map_async(func, iterable, chunksize).get()
252
253 def imap(self, func, iterable, chunksize=1):
/home/notebook/anaconda2/lib/python2.7/multiprocessing/pool.pyc in get(self, timeout)
565 return self._value
566 else:
--> 567 raise self._value
568
569 def _set(self, i, obj):
OSError: [Errno 2] No such file or directory
另外,如果有帮助,我是 运行 Python 2.7.13 |Anaconda 4.4.0.
哦,导致错误的行是 results = pool.map(job, files[:limit])
非常感谢。
在我 post 关注我的评论后,我尝试使用
安装 ffmpeg
sudo apt-get install libav-tools
来自这个link。
不确定如何安装 ffmpeg,但它解决了问题!
如果我应该删除这个 post 请告诉我,但我认为它对其他有类似问题的人有用。 IE。如果您有类似问题,则无需了解映射器和池。
我正在尝试使用此 github repo to do some birdsong analysis. I've come across a problem in the stage where I collect all the sample's into one array('Collect Samples'). I'm getting an error that looks to be something to do with my system. Not sure where to start on fixing the error. (have a look at my link to the github 存储库来获得更深入的信息。)感谢您的观看!
def job(fn):
return load_sample(fn, sr=sr,
max_length=max_length, fixed_length=fixed_length)
pool = Pool()
%time results = pool.map(job, files[:limit])
print 'Processed', len(results), 'samples'
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-8-5d12f8de2a12> in <module>()
3 max_length=max_length, fixed_length=fixed_length)
4 pool = Pool()
----> 5 get_ipython().magic(u'time results = pool.map(job, files[:limit])')
6 print 'Processed', len(results), 'samples'
/home/notebook/anaconda2/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
2156 magic_name, _, magic_arg_s = arg_s.partition(' ')
2157 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2158 return self.run_line_magic(magic_name, magic_arg_s)
2159
2160 #-------------------------------------------------------------------------
/home/notebook/anaconda2/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
2077 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2078 with self.builtin_trap:
-> 2079 result = fn(*args,**kwargs)
2080 return result
2081
<decorator-gen-59> in time(self, line, cell, local_ns)
/home/notebook/anaconda2/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
186 # but it's overkill for just that one bit of state.
187 def magic_deco(arg):
--> 188 call = lambda f, *a, **k: f(*a, **k)
189
190 if callable(arg):
/home/notebook/anaconda2/lib/python2.7/site-packages/IPython/core/magics/execution.pyc in time(self, line, cell, local_ns)
1183 else:
1184 st = clock2()
-> 1185 exec(code, glob, local_ns)
1186 end = clock2()
1187 out = None
<timed exec> in <module>()
/home/notebook/anaconda2/lib/python2.7/multiprocessing/pool.pyc in map(self, func, iterable, chunksize)
249 '''
250 assert self._state == RUN
--> 251 return self.map_async(func, iterable, chunksize).get()
252
253 def imap(self, func, iterable, chunksize=1):
/home/notebook/anaconda2/lib/python2.7/multiprocessing/pool.pyc in get(self, timeout)
565 return self._value
566 else:
--> 567 raise self._value
568
569 def _set(self, i, obj):
OSError: [Errno 2] No such file or directory
另外,如果有帮助,我是 运行 Python 2.7.13 |Anaconda 4.4.0.
哦,导致错误的行是 results = pool.map(job, files[:limit])
非常感谢。
在我 post 关注我的评论后,我尝试使用
安装 ffmpegsudo apt-get install libav-tools
来自这个link。 不确定如何安装 ffmpeg,但它解决了问题!
如果我应该删除这个 post 请告诉我,但我认为它对其他有类似问题的人有用。 IE。如果您有类似问题,则无需了解映射器和池。