root@raspberrypi:/home/pi/Downloads/dejavu# python2 ./example.py 
######## filename: mp3/Brad-Sucks--Total-Breakdown.mp3 
Failed fingerprinting 
Traceback (most recent call last): 
  File "/home/pi/Downloads/dejavu/dejavu/__init__.py", line 79, in fingerprint_d   irectory 
    song_name, hashes, file_hash = iterator.next() 
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 659, in next 
    raise value 
OSError: [Errno 2] No such file or directory 
Traceback (most recent call last): 
  File "./example.py", line 17, in <module> 
    song = djv.recognize(FileRecognizer, "/home/pi/Downloads/dejavu/mp3/Brad-Suc   ks--Total-Breakdown.mp3") 
  File "/home/pi/Downloads/dejavu/dejavu/__init__.py", line 169, in recognize 
    return r.recognize(*options, **kwoptions) 
  File "/home/pi/Downloads/dejavu/dejavu/recognize.py", line 41, in recognize 
    return self.recognize_file(filename) 
  File "/home/pi/Downloads/dejavu/dejavu/recognize.py", line 29, in recognize_fi   le 
    frames, self.Fs, file_hash = decoder.read(filename, self.dejavu.limit) 
  File "/home/pi/Downloads/dejavu/dejavu/decoder.py", line 51, in read 
    audiofile = AudioSegment.from_file(filename) 
  File "/usr/local/lib/python2.7/dist-packages/pydub/audio_segment.py", line 505   , in from_file 
    p = subprocess.Popen(conversion_command, stdout=subprocess.PIPE, stderr=subp   rocess.PIPE) 
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__ 
    errread, errwrite) 
  File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child 
    raise child_exception 
OSError: [Errno 2] No such file or directory 

有人可以帮助我吗?我对 python 是个新手。

我想运行一个Python项目,该项目在Raspberry pi 0 W上被证明是正确的,其系统是像Debian这样的linux,我已经安装了Python 2和python 3。

当我杀死上面的错误时,出现了另一个错误,如下所示:

root@raspberrypi:/home/pi/Downloads/dejavu# python2 example.py                     ######## filename: mp3/Brad-Sucks--Total-Breakdown.mp3 
Fingerprinting channel 1/2 for mp3/Brad-Sucks--Total-Breakdown.mp3 
Failed fingerprinting 
Traceback (most recent call last): 
  File "/home/pi/Downloads/dejavu/dejavu/__init__.py", line 79, in fingerprint_directory 
    song_name, hashes, file_hash = iterator.next() 
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 659, in next 
    raise value 
MemoryError 
Traceback (most recent call last): 
  File "example.py", line 17, in <module> 
    song = djv.recognize(FileRecognizer, "/home/pi/Downloads/dejavu/mp3/Brad-Sucks--Total-Breakdown.mp3") 
  File "/home/pi/Downloads/dejavu/dejavu/__init__.py", line 169, in recognize 
    return r.recognize(*options, **kwoptions) 
  File "/home/pi/Downloads/dejavu/dejavu/recognize.py", line 41, in recognize 
    return self.recognize_file(filename) 
  File "/home/pi/Downloads/dejavu/dejavu/recognize.py", line 32, in recognize_file 
    match = self._recognize(*frames) 
  File "/home/pi/Downloads/dejavu/dejavu/recognize.py", line 17, in _recognize 
    matches.extend(self.dejavu.find_matches(d, Fs=self.Fs)) 
  File "/home/pi/Downloads/dejavu/dejavu/__init__.py", line 118, in find_matches 
    hashes = fingerprint.fingerprint(samples, Fs=Fs) 
  File "/home/pi/Downloads/dejavu/dejavu/fingerprint.py", line 83, in fingerprint 
    noverlap=int(wsize * wratio))[0] 
  File "/usr/lib/python2.7/dist-packages/matplotlib/mlab.py", line 1315, in specgram 
    mode=mode) 
  File "/usr/lib/python2.7/dist-packages/matplotlib/mlab.py", line 759, in _spectral_helper 
    result = np.conjugate(result) * result 
MemoryError 

有人遇到过类似的问题吗?

请您参考如下方法:

解决OSError: [Errno 2] No such file or directory

的方法

安装FFmpegLibav

因为FFmpeg快被Linux淘汰了,所以我安装了Libva

sudo apt-get install libav-tools

解决MemoryError的方法

更改一个小mp3文件以进行指纹识别

因为我的CPU RAM太小,无法处理大文件


评论关闭
IT源码网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!