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

#1980 (venv) D:\python\f5ttsnew>f5-tts_infer-gradioTraceback (most recent call last): File "C:\Users\zqpzq\AppData\Local\P

23.165* Posted at: 2 days ago 👁21

(venv) D:\python\f5ttsnew>f5-tts_infer-gradio
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 17, in

import torch

ModuleNotFoundError: No module named 'torch'

1 Replies

您遇到的错误 ModuleNotFoundError: No module named 'torch' 表明您的 Python 环境中没有安装 PyTorch,这是 F5-TTS 运行所必需的依赖。

请按以下步骤解决:

  1. 激活虚拟环境:确保您已进入正确的虚拟环境。在 D:\python\f5ttsnew 目录下,执行:

    venv\Scripts\activate

    命令行提示符前应出现 (venv) 字样。

  2. 安装 PyTorch

    • 推荐(使用 pip):访问 PyTorch 官网 (https://pytorch.org/get-started/locally/),根据您的系统(Windows)、Python 版本(3.10)和 CUDA 版本(如果有 NVIDIA 显卡并已安装 CUDA)或选择“CPU”来生成对应的安装命令。
    • 通用命令示例(CPU版本)

      pip install torch torchvision torchaudio
    • 如果您有 NVIDIA 显卡并已安装 CUDA 12.1

      pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
  3. 重新启动 F5-TTS:安装完成后,再次运行命令:

    f5-tts_infer-gradio

如果问题依旧,请检查虚拟环境是否正确激活,或尝试在虚拟环境中使用 pip list 命令查看已安装的包,确认 torch 是否在列表中。

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

Similar issues already exist

Trending Questions