whisper执行ffmpeg时,报错: hp, ht, pid, tid = _winapi.CreateProcess(executable, args, 系统找不到指定的文件。
最新推荐文章于 2024-05-14 00:23:23 发布
最新推荐文章于 2024-05-14 00:23:23 发布 阅读量 7.3k Automati_file = r"20230302152850300.mp3" #音频路径 model = whisper.load_model("small",download_root = download_root) result = model.transcribe(Automati_file,language="zh",fp16=False) print(result)

执行代码后,报错:

-> 1420     hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
   1421                              # no special security
   1422                              None, None,
   1423                              int(not close_fds),
   1424                              creationflags,
   1425                              env,
   1426                              cwd,
   1427                              startupinfo)
   1428 finally:
   1429     # Child is launched. Close the parent's copy of those pipe
   1430     # handles that only the child should have open.  You need
   (...)
   1433     # pipe will not close when the child process exits and the
   1434     # ReadFile will hang.
   1435     self._close_pipe_fds(p2cread, p2cwrite,
   1436                          c2pread, c2pwrite,
   1437                          errread, errwrite)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

 这个时候很大可能是这个_winapi.CreateProcess(executable, args,.....)中executable的问题。

当我们直接调用模型进行语音转问文字时,会调用fmpeg对数据进行处理

     41     out, _ = (
---> 42         ffmpeg.input(file, threads=0)
     43         .output("-", format="s16le", acodec="pcm_s16le", ac=1, ar=sr)
     44         .run(cmd=["ffmpeg", "-nostdin"], capture_stdout=True, capture_stderr=True)
     45     )

此时需要一个ffmpeg.exe 的系统变量进行调用执行。

解决方法:

在电脑中配置好ffmpeg.exe的路径:

找到 ffmpeg.exe 路径:

配置到系统变量中:

 (Pycharm记得关闭重启。)

重新运行一下上述代码,就可以正常执行并输出结果了。

Whisper是OpenAI于2022年9月份开源的通用的语音识别模型。它是在各种音频的大型数据集上训练的模型,也是一个可以执行多语言语音识别、语音翻译和语言识别的多任务模型。论文链接:https://arxiv.org/abs/2212.04356github链接:https://github.com/openai/whisper。 FileNotFoundError[WinError2]系统不到指定文件类似问题解决办法。,即adb该命令未加入环境变量,那我们只需将adb加入环境变量即可。其中_ADB变量值为adb;这句话的意思是在cmd中执行。通过代码寻,发现代码出现在这句。并返回执行结果,这里返回的结果为。系统不到指定文件。...... 虽然前不久就开始使用了PySide 6,可是最近在更新翻译文件(ts),发现pyside6-lupdate命令无法运行,报错如下: (venv) D:\JetBrains\PycharmProjects\pythonProject>pyside6-lupdate Traceback (most recent call last): File "C:\Users\MyPC\AppData\Local\Programs\Python\Python39\lib\runp 运行报错FileNotFoundError:[WinError 2]系统不到指定文件,问题出在系统不到git.exe可执行文件上,对应的解决方案就是自行下载git.exe文件,然后将路径添加到程序。 通过cmd输入pip install pytesseract进行安装,但是安装后并不能直接使用,还需要下载Tesseract-OCR pytesseract最新版本0.1.6,网址:pytesseract · PyPI a、Python-tesseract是一个独立封装包; b、Python-tesseract功能是识别 【selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 】【in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] 系统不到指定文件。】 我碰到的问题和这位老哥很像https://ask.csdn.net/questions/695597,真是同是天涯沦落人啊。 我之前用的anaconda2,后来因为其他原因需要使用anaconda3,当我卸载掉anaconda2的候发现,安装anaconda3出现问题了。这个问题后来查询百度,基本上都是failed to create anacoda menu。无法生成anaconda 快捷方...... 我把vscode改成以管理员运行,然后在vscode中打开终端就是管理员的权限。问题能够得到解决,但是总感觉这样不是很好~~PermissionError: [WinError 5] 拒绝访问。最近在Django项目迁移到其他电脑,使用。查了很久,应该是权限问题。 FileNotFoundError: [WinError 2] 系统不到指定文件。配置完成后运行cmd,输入ffmpeg,若显示如下界面,则说明配置成功。右击此电脑——>属性——>高级系统设置——>环境变量。下载下图压缩包,并解压。 错误检索={ 1.Warning (from warnings module): browser = webdriver.Chrome(chrome_options=options) DeprecationWarning: use options instead of chrome_options Traceback ...