#5509 语音识别阶段出错[WhisperX(本地API)] Error code: 500 - {'error': '转录过程中发生错误: Torch not compiled with CUDA enabled'}Traceback (most

15.235* Posted at: 2 hours ago

语音识别阶段出错[WhisperX(本地API)] Error code: 500 - {'error': '转录过程中发生错误: Torch not compiled with CUDA enabled'}
Traceback (most recent call last):

File "videotrans\task\job.py", line 35, in run

File "videotrans\task\job.py", line 100, in process_task

File "videotrans\task\trans_create.py", line 319, in recogn

File "videotrans\recognition\__init__.py", line 191, in run

File "videotrans\recognition\_base.py", line 90, in run

File "videotrans\recognition\_whisperx.py", line 32, in _exec

File "openai\_utils\_utils.py", line 298, in wrapper

File "openai\resources\audio\transcriptions.py", line 485, in create

File "openai\_base_client.py", line 1332, in post

File "openai\_base_client.py", line 1105, in request

openai.InternalServerError: Error code: 500 - {'error': '转录过程中发生错误: Torch not compiled with CUDA enabled'}
cfg=[TaskCfgVTT]当前工作模式: 转录并翻译字幕
原始输入文件名: G:/新建文件夹/1/cc/1080P_4000K_115306181.mp4,
输出结果保存到文件夹: G:/新建文件夹/1/cc/_video_out/1080P_4000K_115306181-mp4,
临时文件夹: D:/Tool/win-pyvideotrans-v4.03-0622/tmp/26016/c9378e4a9b
已选 清理已存在
已选 启用CUDA加速
未选 降噪
语音识别:WhisperX(本地API), model_name: distil-large-v3.5, 发音语言: 英语, 断句方式:默认断句
翻译渠道:Google(免费),原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
已选 将生成的字幕复制到视频目录下
输出字幕格式: 单字幕
代理地址:


=
system:Windows-10-10.0.26200-SP0
version:v4.03
frozen:True
language:zh
root_dir:D:/Tool/win-pyvideotrans-v4.03-0622

1 Replies

语音识别渠道 WhisperX(本地API) 报错 Torch not compiled with CUDA enabled 的根本原因是:您自行部署的 WhisperX 服务端环境中,PyTorch 安装的是 CPU 版本,而您又在 pyVideoTrans 主界面勾选了 启用CUDA加速,导致服务端无法响应 CUDA 请求。

解决方案

  1. 检查 WhisperX 部署环境:确认服务端是否安装了 CUDA 版本的 PyTorch,以及显卡驱动、CUDA Toolkit、cuDNN 是否匹配。

    • 卸载当前 PyTorch:pip uninstall torch torchvision torchaudio
    • 安装 CUDA 12.x 对应版本(例如 pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
  2. 临时绕过:如果您不要求 GPU 加速,可在 pyVideoTrans 主界面取消勾选 CUDA加速,改用 CPU 处理。但 CPU 模式下 WhisperX 识别速度会极慢。
  3. 确认服务端已正确启动:确保 WhisperX API 服务(如 whisperx-api)在启动时加载了 CUDA 版 PyTorch,并输出 CUDA available: True

请查阅相关文档:

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. Dondate: ko-fi.com/jianchang512

Related resource