#5530 videotrans.configure.excepts.DubbingSrtError: Audio denoising processing failed: CUDA out of memory. Tried to allocate 1

14.145* Posted at: 1 hour ago

Audio denoising processing failed: CUDA out of memory. Tried to allocate 108.00 MiB. GPU 0 has a total capacity of 8.00 GiB of which 0 bytes is free. Of the allocated memory 6.81 GiB is allocated by PyTorch, and 423.16 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables):
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 16, in run
File "videotrans\tts\__init__.py", line 192, in run
File "videotrans\tts\_base.py", line 133, in run
videotrans.configure.excepts.DubbingSrtError: Audio denoising processing failed: CUDA out of memory. Tried to allocate 108.00 MiB. GPU 0 has a total capacity of 8.00 GiB of which 0 bytes is free. Of the allocated memory 6.81 GiB is allocated by PyTorch, and 423.16 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)


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

1 Replies

“CUDA out of memory” 错误原因:你的 NVIDIA 显卡(8 GiB)已被 PyTorch 占用绝大部分显存(6.81 GiB),无法再为音频降噪处理分配所需的 108 MiB。这通常是同时运行的模型过大或存在显存泄漏。

解决方案(按推荐顺序尝试):

  1. 关闭其他占用 GPU 的程序:检查是否有其他训练、推理进程(如另一个 pyVideoTrans 任务、Chrome 硬件加速等)正在占用显存。可在任务管理器中结束这些进程,或重启软件。
  2. 切换降噪模式为纯 CPU 执行
    在软件主界面点击 “设置更多参数” → 取消勾选 “分离人声背景声” 或 “降噪” 中的 GPU 加速选项。如需继续使用降噪,可进入 菜单→工具→高级选项→语音识别参数,将 “分离背景声模型” 切换为更轻量的模型(如 UVR-MDX-NET-Inst_HQ_2 换成 UVR-MDX-NET-Inst_1),或直接使用 CPU 模式(速度较慢但不会爆显存)。
  3. 减少当前 GPU 任务并发数
    菜单→工具→高级选项→通用设置 中,将 “GPU同时任务数” 设为 1,并确保未启用 “多显卡模式”。
  4. 释放显存并临时清理缓存
    勾选主界面 “清理已生成”,清理 tmp/ 目录下的临时切片文件,再重新执行任务。
  5. 降低其他环节的显存占用(如果还有其他 GPU 运算):

    • 在高级选项 → 语音识别参数中,将 “计算数据类型” 改为 int8(最省显存),beam_sizebest_of 设为 1
    • 关闭 “启用上下文感知”。
    • 如使用本地模型(faster-whisper),换用更小的模型(如 medium 替代 large-v3)。

请查阅相关文档:

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