点击查看 Edge-TTS 配音渠道无法使用的解决办法!!!

#1957 (venv) D:\python\f5ttsnew>f5-tts_infer-gradioTraceback (most recent call last): File "D:\python\f5ttsnew\venv\lib\si

45.146* Posted at: 12 hours ago 👁13

(venv) D:\python\f5ttsnew>f5-tts_infer-gradio
Traceback (most recent call last):
File "D:\python\f5ttsnew\venv\lib\site-packages\torch\_ops.py", line 1488, in load_library

ctypes.CDLL(path)

File "C:\Users\zqpzq\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 374, in init

self._handle = _dlopen(self._name, mode)

FileNotFoundError: Could not find module 'D:\python\f5ttsnew\venv\Lib\site-packages\torchaudio\lib\libtorchaudio.pyd' (or one of its dependencies). Try using the full path with constructor syntax.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\zqpzq\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main

return _run_code(code, main_globals, None,

File "C:\Users\zqpzq\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code

exec(code, run_globals)

File "D:\python\f5ttsnew\venv\Scripts\f5-tts_infer-gradio.exe\__main__.py", line 4, in

from f5_tts.infer.infer_gradio import main

File "D:\python\f5ttsnew\src\f5_tts\infer\infer_gradio.py", line 18, in

import torchaudio

File "D:\python\f5ttsnew\venv\lib\site-packages\torchaudio\__init__.py", line 7, in

from . import _extension  # noqa  # usort: skip

File "D:\python\f5ttsnew\venv\lib\site-packages\torchaudio\_extension\__init__.py", line 37, in

_load_lib("libtorchaudio")

File "D:\python\f5ttsnew\venv\lib\site-packages\torchaudio\_extension\utils.py", line 58, in _load_lib

torch.ops.load_library(path)

File "D:\python\f5ttsnew\venv\lib\site-packages\torch\_ops.py", line 1490, in load_library

raise OSError(f"Could not load this library: {path}") from e

OSError: Could not load this library: D:\python\f5ttsnew\venv\Lib\site-packages\torchaudio\lib\libtorchaudio.pyd

1 Replies

您的问题与 pyVideoTrans 无关,这是您在独立部署 F5-TTS 语音合成模型时遇到的 torchaudio 库加载失败错误。

核心原因是 torchaudio 库文件损坏或与当前 PyTorch 版本不兼容。请按以下步骤解决:

  1. 卸载并重新安装匹配的 torchaudiotorch

    • 在您的虚拟环境 (venv) 中,执行以下命令:

      pip uninstall torch torchaudio torchvision -y
    • 然后根据您的 CUDA 版本(或 CPU 环境)重新安装。例如,对于 CUDA 11.8,可以尝试:

      pip install torch torchaudio torchvision --index-url https://download.pytorch.org/whl/cu118
    • 如果您不确定 CUDA 版本或使用 CPU,请使用以下命令安装 CPU 版本:

      pip install torch torchaudio torchvision --index-url https://download.pytorch.org/whl/cpu
  2. 验证安装:
    重新安装后,在 Python 交互环境中运行 import torchaudio,确认不再报错。
  3. 重新启动 F5-TTS:
    修复库依赖后,再次运行 f5-tts_infer-gradio 命令。

如果问题依旧,建议检查 F5-TTS 项目的官方文档或 Issues 页面,查看是否有特定的 PyTorch 版本要求。

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Donate: https://ko-fi.com/jianchang512

Trending Questions