#5885 语音识别阶段出错[faster-whisper(本地内置)] Subprocess Error: Backend should be defined in the BACKENDS_MAPPING. Offending backend: t

192.236* Posted at: 1 hour ago

语音识别阶段出错[faster-whisper(本地内置)] Subprocess Error: Backend should be defined in the BACKENDS_MAPPING. Offending backend: tensorflow_text
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\_stage_recogn.py", line 62, in recogn

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

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

File "videotrans\recognition\_whisper.py", line 38, in _exec

File "videotrans\recognition\_whisper.py", line 124, in _faster

File "videotrans\configure\base.py", line 272, in _new_process

videotrans.configure.excepts.VideoTransError: Subprocess Error: Backend should be defined in the BACKENDS_MAPPING. Offending backend: tensorflow_text
cfg=[TaskCfgVTT]当前工作模式: 转录并翻译字幕
原始输入文件名: K:/movie/Xvideos/3D/3d monster helena the alien carrier 26regionsfm.mp4,
输出结果保存到文件夹: K:/movie/Xvideos/3D/_video_out/3d monster helena the alien carrier 26regionsfm-mp4,
临时文件夹: D:/Program files/sp/tmp/20632/e7ac6b8d37
未选 清理已存在
已选 启用CUDA加速
未选 降噪
语音识别:faster-whisper(本地内置), model_name: large-v3-turbo, 发音语言: 英语, 断句方式:默认断句
翻译渠道:兼容AI/本地模型,原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
输出字幕格式: 单字幕
代理地址:


=
system:Windows-10-10.0.26200-SP0
version:v4.06
frozen:True
language:zh
root_dir:D:/Program files/sp

9 Replies

这是因 ctranslate2 后端映射出错导致的,通常是由于系统中混装了 TensorFlow 相关库(如 tensorflow-text)或模型缓存损坏,使 faster-whisper 尝试加载不存在的后端 tensorflow_text

解决方案

  1. 检查并移除 TensorFlow 相关库
    打开命令提示符,执行 pip list | findstr tensorflow,若看到 tensorflowtensorflow-text 等,执行 pip uninstall tensorflow tensorflow-text 彻底卸载(仅对源码部署有效;预打包版请跳过此步)。
  2. 清除模型缓存,强制重新下载
    删除软件目录下 models/models--mobiuslabsgmbh--faster-whisper-large-v3-turbo 文件夹,然后重启软件,让系统自动重新下载模型。
  3. 切换计算数据类型
    进入 菜单 → 工具 → 高级选项 → 语音识别参数,将 计算数据类型 改为 float16(GPU 加速最佳),保存后重试。
  4. 更换模型版本
    如果仍报错,尝试将 语音识别渠道 中的模型改为 large-v3(非 turbo 版),该模型更稳定。

若以上操作均无效,请提供 logs/ 目录下最新的 .log 文件内容(复制底部约 30 行),以便进一步排查。

请查阅相关文档:

Starting sequential faster-whisper inference.

Traceback (most recent call last):
File "videotrans\recognition\_xxl.py", line 42, in _exec
File "subprocess.py", line 526, in run
subprocess.CalledProcessError: Command '['C:/Users/lives/AppData/Roaming/Subtitle Edit/SpeechToText/Purfview-Faster-Whisper-XXL/faster-whisper-xxl.exe', 'D:/Program files/sp/tmp/25252/e7ac6b8d37/en.wav', '-pp', '-f', 'srt', '-ct', 'float16', '-l', 'en', '--model', 'large-v3', '--output_dir', 'D:/Program files/sp/tmp/25252/e7ac6b8d37']' returned non-zero exit status 3221226505.

During handling of the above exception, another exception occurred:

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\_stage_recogn.py", line 62, in recogn
File "videotrans\recognition\__init__.py", line 205, in run
File "videotrans\recognition\_base.py", line 91, in run
File "videotrans\recogniti
......
y", line 1016, in _bootstrap_inner
File "threading.py", line 953, in run
File "D:\whisper-fast-XXL\__main__.py", line 2171, in pbar_delayed
IndexError: list index out of range
Exception in thread Thread-64 (pbar_delayed):
Traceback (most recent call last):
File "threading.py", line 1016, in _bootstrap_inner
File "threading.py", line 953, in run
File "D:\whisper-fast-XXL\__main__.py", line 2171, in pbar_delayed
IndexError: list index out of range
Exception in thread Thread-65 (pbar_delayed):
Traceback (most recent call last):
File "threading.py", line 1016, in _bootstrap_inner
File "threading.py", line 953, in run
File "D:\whisper-fast-XXL\__main__.py", line 2171, in pbar_delayed
IndexError: list index out of range
Exception in thread Thread-66 (pbar_delayed):
Traceback (most recent call last):
File "threading.py", line 1016, in _bootstrap_inner
File "threading.py", line 953, in run
File "D:\whisper-fast-XXL\__main__.py", line 2171, in pbar_delayed
IndexError: list index out of range
Exception in thread Thread-67 (pbar_delayed):
Traceback (most recent call last):
File "threading.py", line 1016, in _bootstrap_inner
File "threading.py", line 953, in run
File "D:\whisper-fast-XXL\__main__.py", line 2171, in pbar_delayed
IndexError: list index out of range
Exception in thread Thread-68 (pbar_delayed):
Traceback (most recent call last):
File "threading.py", line 1016, in _bootstrap_inner
File "threading.py", line 953, in run
File "D:\whisper-fast-XXL\__main__.py", line 2171, in pbar_delayed
IndexError: list index out of range
Exception in thread Thread-69 (pbar_delayed):
Traceback (most recent call last):
File "threading.py", line 1016, in _bootstrap_inner
File "threading.py", line 953, in run
File "D:\whisper-fast-XXL\__main__.py", line 2171, in pbar_delayed
IndexError: list index out of range
Exception in thread Thread-70 (pbar_delayed):
Traceback (most recent call last):
File "threading.py", line 1016, in _bootstrap_inner
File "threading.py", line 953, in run
File "D:\whisper-fast-XXL\__main__.py", line 2171, in pbar_delayed
IndexError: list index out of range
Exception in thread Thread-71 (pbar_delayed):
Traceback (most recent call last):
File "threading.py", line 1016, in _bootstrap_inner
File "threading.py", line 953, in run
File "D:\whisper-fast-XXL\__main__.py", line 2171, in pbar_delayed
IndexError: list index out of range
Traceback (most recent call last):
File "D:\whisper-fast-XXL\__main__.py", line 2324, in
File "D:\whisper-fast-XXL\__main__.py", line 2211, in cli
IndexError: list index out of range
[PYI-17060:ERROR] Failed to execute script '__main__' due to unhandled exception!

Standalone Faster-Whisper-XXL r245.4 running on: CUDA

Note: 'large-v3' model may produce worse results than 'large-v2'!

Starting to process: D:/Program files/sp/tmp/25252/e7ac6b8d37/en.wav

Starting sequential faster-whisper inference.

这是 Faster-Whisper-XXL 可执行文件崩溃导致的。错误码 3221226505 对应堆损坏(C0000374),结合 XXL 内部大量 IndexError: list index out of range,说明 XXL 版本过旧或模型缓存损坏。

解决方案

  1. 立即切换渠道:在主界面 "语音识别" 中,改为使用 faster-whisper(本地内置) 并选 large-v3large-v3-turbo 模型,这是最稳定可靠的选择。
  2. 更新 Faster-Whisper-XXL(如果你仍想用 XXL):

    • 前往 Faster-Whisper-XXL 官方发布页 下载最新版(如 r245.4 或更高版本)。
    • 解压后,在 菜单 → TTS设置 → Faster-Whisper-XXL 渠道设置 中重新指定 .exe 路径。
    • 注意:large-v3 模型在 XXL 中有已知问题(日志也提示 large-v3 model may produce worse results than large-v2!),建议使用 large-v2
  3. 清理模型缓存:删除 软件目录/models/models--PurfView--faster-whisper-XXL 文件夹,避免使用损坏的模型文件。
  4. 安装 VC++ 运行库:确保系统已安装 Microsoft Visual C++ 2015-2022 Redistributable x64,缺失该库也会导致 exe 崩溃。

完成上述操作后重启软件再试。若问题依旧,请提供 logs/ 文件夹下最新的日志文件(约 30 行),以便进一步定位。

改为使用 faster-whisper(本地内置) 并选 large-v3 仍然出错:

语音识别阶段出错[faster-whisper(本地内置)] Subprocess Error: Backend should be defined in the BACKENDS_MAPPING. Offending backend: tensorflow_text
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\_stage_recogn.py", line 62, in recogn

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

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

File "videotrans\recognition\_whisper.py", line 52, in _download

File "videotrans\recognition\_base.py", line 182, in _vad_split

File "videotrans\configure\base.py", line 272, in _new_process

videotrans.configure.excepts.VideoTransError: Subprocess Error: Backend should be defined in the BACKENDS_MAPPING. Offending backend: tensorflow_text
cfg=[TaskCfgVTT]当前工作模式: 转录并翻译字幕
原始输入文件名: K:/movie/Xvideos/3D/3d monster helena the alien carrier 26regionsfm.mp4,
输出结果保存到文件夹: K:/movie/Xvideos/3D/_video_out/3d monster helena the alien carrier 26regionsfm-mp4,
临时文件夹: D:/Program files/sp/tmp/25252/e7ac6b8d37
未选 清理已存在
已选 启用CUDA加速
未选 降噪
语音识别:faster-whisper(本地内置), model_name: large-v3, 发音语言: 英语, 断句方式:默认断句
翻译渠道:兼容AI/本地模型,原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
输出字幕格式: 单字幕
代理地址:

问题根源仍是系统中存在 tensorflow_text 库干扰了 faster-whisper 子进程,同时你当前的错误堆栈显示失败发生在 VAD 预分割阶段_vad_split),VAD 模型(silero-vad)在某些情况下会错误地加载 TensorFlow 后端导致崩溃。

请按以下顺序逐一尝试,通常第一步即可解决:


1️⃣ 关闭「Whisper预分割音频」

这是最快速的方法,跳过 VAD 预处理,直接使用 faster-whisper 内置分割引擎。

操作:进入 菜单 → 工具 → 高级选项 → 语音识别参数,找到 Whisper预分割音频?取消勾选,点击保存,然后重试。

关闭后识别速度可能会变慢,但稳定性大幅提升,尤其适合你这种不受控的环境。

2️⃣ 切换为 openai-whisper(本地内置)

openai-whisper 不依赖 ctranslate2 和 tensorflow_text,完全绕过该 Bug。

操作:在主界面的「语音识别」渠道中选择 openai-whisper(本地内置),模型仍然选 large-v3,勾选 CUDA 加速。


3️⃣ 彻底清除模型缓存,强制重新下载

如果系统环境变量中已经被注入 tensorflow,即使关闭预分割也可能在子进程中触发。请执行:

  1. 关闭软件。
  2. 删除以下两个文件夹:

    • 软件目录/models/models--Systran--faster-whisper-large-v3
    • 软件目录/models/onnx(如果里面包含 VAD 模型文件,会被重建)
  3. 重新打开软件,软件会自动重新下载干净的模型文件。
⚠️ 由于你使用的是 预打包版,无法执行 pip,因此删除缓存是最稳妥的“清除中毒环境”方式。

4️⃣ (终极方案)重新下载完整包

如果你的 sp.exe 是从旧版升级上来的,可能残留了早期有问题的 dll。

  • 前往官网下载 最新完整版压缩包(约 2.6GB),解压到全英文路径(如 D:\pyVideoTrans),再次试用 faster-whisper 渠道。

5️⃣ 如果所有方法都无效

请提供 logs/ 文件夹下最新日志文件的前 30 行和后 30 行,以便确认系统环境中是否还注入了其他异常路径。


请查阅相关文档:

[DEBUG] 可用 Nvidia 显卡数: 1
[DEBUG] 找到 1 个 Nvidia GPUs, 耗时: 4s
[DEBUG] 返回缓存的编解码器 Windows-264: h264_nvenc
[DEBUG] 返回缓存的编解码器 Windows-265: hevc_nvenc

[DEBUG] start 9 jobs
[DEBUG] app_cfg.proxy=''
[DEBUG] 可以使用 huggingface.co
[DEBUG] 批量翻译模式并不限制数量
[DEBUG] [TransCreate]最终配置信息:self=TransCreate(uuid='e7ac6b8d37', proxy_str=None, last_down_time=0, precent=1, hasend=False, should_recogn=True, should_trans=True, should_dubbing=False, should_separate=True, should_hebing=False, source_srt_list=[], target_srt_list=[], video_time=0.0, is_copy_video=False, video_codec_num=264, ignore_align=False, is_audio_trans=False, clone_ref='', cost_duration=1784294710.9087696, should_recogn2=False)
self.cfg=[TaskCfgVTT]当前工作模式: 转录并翻译字幕
原始输入文件名: K:/movie/Xvideos/3D/3d monster helena the alien carrier 26regionsfm.mp4,
输出结果保存到文件夹: K:/movie/Xvideos/3D/_video_out/3d monster helena the alien carrier 26regionsfm-mp4,
临时文件夹: D:/Program files/sp/tmp/22620/e7ac6b8d37
未选 清理已存在
已选 启用CUDA加速
未选 降噪
语音识别:faster-whisper(本地内置), model_name: large-v3, 发音语言: 英语, 断句方式:默认断句
翻译渠道:兼容AI/本地模型,原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
输出字幕格式: 单字幕
代理地址:
[DEBUG] The file info after process:result={'video_fps': 30.0, 'r_frame_rate': 30.0, 'video_codec_name': 'h264', 'audio_codec_name': 'aac', 'width': 1280, 'height': 720, 'time': 2102392, 'streams_len': 2, 'streams_audio': 1, 'video_streams': 1, 'color': 'yuv420p'}
[DEBUG] 存在单独的人声文件 vocal.wav, 使用此作为语音识别原始音频

[DEBUG] app_cfg.proxy=None
[DEBUG] 可以使用 huggingface.co
Returning existing local_dir D:\Program files\sp\models\models--Systran--faster-whisper-large-v3 as remote repo cannot be accessed in snapshot_download (None).
[DEBUG] [新进程任务 开始:title='STT use large-v3']
[DEBUG] 新进程任务 参数:kwargs={'detect_language': 'en', 'model_name': 'large-v3', 'logs_file': 'D:/Program files/sp/tmp/22620/e7ac6b8d37/faster-en-1784294714.8077073.log', 'is_cuda': True, 'no_speech_threshold': 0.5, 'condition_on_previous_text': False, 'speech_timestamps': None, 'audio_file': 'D:/Program files/sp/tmp/22620/e7ac6b8d37/en.wav', 'local_dir': 'D:/Program files/sp/models/models--Systran--faster-whisper-large-v3', 'compute_type': 'float16', 'jianfan': False, 'audio_duration': 2102335, 'hotwords': '', 'prompt': '', 'beam_size': 5, 'best_of': 5, 'temperature': '0.0', 'repetition_penalty': 1.0, 'compression_ratio_threshold': 2.2, 'max_speech_ms': 10000, 'subtitle_srt': 'D:/Program files/sp/tmp/faster-20260717-21_25_14.srt', 'device_index': 0}
[DEBUG] GPU进程池:max_workers=1
[ERROR] GPU进程池回调异常: Backend should be defined in the BACKENDS_MAPPING. Offending backend: tf
[DEBUG] [新进程任务 title='STT use large-v3'] 已返回
[ERROR] STT use large-v3,Subprocess Error: Backend should be defined in the BACKENDS_MAPPING. Offending backend: tf
Traceback (most recent call last):
File "videotrans\configure\base.py", line 272, in _new_process
videotrans.configure.excepts.VideoTransError: Subprocess Error: Backend should be defined in the BACKENDS_MAPPING. Offending backend: tf
[DEBUG] [新进程任务 结束:title='STT use large-v3'],耗时8.121343612670898s
[ERROR] Subprocess Error: Backend should be defined in the BACKENDS_MAPPING. Offending backend: tf
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\_stage_recogn.py", line 62, in recogn
File "videotrans\recognition\__init__.py", line 205, in run
File "videotrans\recognition\_base.py", line 91, in run
File "videotrans\recognition\_whisper.py", line 38, in _exec
File "videotrans\recognition\_whisper.py", line 124, in _faster
File "videotrans\configure\base.py", line 272, in _new_process
videotrans.configure.excepts.VideoTransError: Subprocess Error: Backend should be defined in the BACKENDS_MAPPING. Offending backend: tf

这是由于您的系统中全局安装了 TensorFlow(或 tensorflow-text),导致 faster-whisper 底层的 ctranslate2 在子进程中错误地尝试使用 tf 作为后端,而该后端并不被支持。此问题对预打包版同样有效,因为子进程会继承系统环境变量或 Python 路径。

解决方案(按推荐优先级)

方案一:切换为 openai-whisper(立即生效,无需卸载任何东西)

openai-whisper 不依赖 ctranslate2,完全不受 TensorFlow 干扰,且效果相当。

操作步骤:

  1. 在主界面「语音识别」渠道中选择 openai-whisper(本地内置)
  2. 模型仍选 large-v3
  3. 确保勾选 CUDA 加速
  4. 点击 开始
若第一次使用 openai-whisper 会自动下载模型,请耐心等待。

方案二(仅限源码部署或可执行命令行):禁用 ctranslate2 的 TensorFlow 后端

如果您必须使用 faster-whisper(例如需要极速),可通过环境变量强制隔离。

Windows 预打包版用户:在桌面创建 sp.exe 的快捷方式,右键 → 属性 → 快捷方式 → 目标,在末尾添加环境变量,例如:

set CT2_TENSORFLOW_BACKEND=0 & set TF_CPP_MIN_LOG_LEVEL=3 & "D:\Program files\sp\sp.exe"

或直接修改启动脚本(无则忽略)。注意:预打包版可能无法通过此法生效,因为子进程环境依然继承系统。更稳妥是用方案三。

方案三:卸载全局 TensorFlow(谨慎操作)

若您系统中有通过 pip/conda 安装的 TensorFlow,请卸载:

pip uninstall tensorflow tensorflow-text -y

然后重启软件。此操作可能影响其他依赖 TensorFlow 的应用,请确认不影响其他软件后再执行。

方案四:彻底重置模型缓存+改用 small 或 large-v2 模型

有时模型缓存本身被污染(下载的中途被 TensorFlow 后端介入)。

  1. 关闭软件。
  2. 删除 models/models--Systran--faster-whisper-large-v3 整个文件夹。
  3. 重新打开软件,选择 smalllarge-v2(非 large-v3),再次尝试。某些旧版 ctranslate2 与 large-v3 的格式兼容性有问题。

如果以上均无法解决

请提供您系统中 pip 列表的简略版(运行 pip list | findstr tensor 并截图),以及软件根目录下是否包含 _internal 文件夹(判断是否为完整包)。

请查阅相关文档:

我是从v3.9版本升级到v4.06以后出现此问题的,回滚到3.9如何?

回滚到 v3.9 的步骤:下载 v3.9 完整版压缩包访问 pyVideoTrans 官网 下载页面,找到 v3.9 版本的完整包(约 2.6GB)。注意区分补丁包和完整包,请下载带版本号的完整包。备份当前配置(可选但推荐)将当前软件目录下的 videotrans/params.json 和 videotrans/cfg.json 复制到安全位置,以便后续恢复。完全解压旧版本将下载的 v3.9 压缩包解压到新的独立文件夹(如 D:\pyVideoTrans_v3.9),不要覆盖 v4.06 的文件夹,避免混淆。运行 sp.exe直接双击启动即可,v3.9 不使用 v4.06 的配置(如果之前备份了 params.json,可复制到新目录的 videotrans/ 下)。回滚后,faster-whisper 应能正常工作。⚠️ 注意事项:v3.9 可能缺少部分新功能(如某些新配音渠道),回滚后无法使用。若仍需 v4.06 的新功能,建议在新版本中改用 openai-whisper(本地内置) 替代 faster-whisper,可彻底避免此 ctranslate2 后端报错。如果回滚后问题依旧,说明系统环境确实被 TensorFlow 污染,需执行系统级清理(卸载 tensorflow)。

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 via ko-fi.com

Dondate via PayPal

Related resource