#5814 配音阶段出错 [OmniVoice(本地内置)] CUDA out of memory. Tried to allocate 516.00 MiB. GPU 0 has a total capacity of 8.00 GiB of whi

113.200* Posted at: 15 hours ago

配音阶段出错 [OmniVoice(本地内置)] CUDA out of memory. Tried to allocate 516.00 MiB. GPU 0 has a total capacity of 8.00 GiB of which 0 bytes is free. Of the allocated memory 14.00 GiB is allocated by PyTorch, and 26.20 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\task\job.py", line 35, in run

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

File "videotrans\task\_stage_dubbing.py", line 23, in dubbing

File "videotrans\task\_stage_dubbing.py", line 102, in _tts

File "videotrans\tts\__init__.py", line 207, in run

File "videotrans\tts\_base.py", line 93, in run

File "videotrans\tts\_omnivoice.py", line 119, in _exec

File "omnivoice\models\omnivoice.py", line 277, in from_pretrained

audio_tokenizer_path, device_map=tokenizer_device

File "G:\fanyi\_internal\transformers\modeling_utils.py", line 4137, in from_pretrained

loading_info, disk_offload_index = cls._load_pretrained_model(model, state_dict, checkpoint_files, load_config)

File "G:\fanyi\_internal\transformers\modeling_utils.py", line 4216, in _load_pretrained_model

caching_allocator_warmup(model, expanded_device_map, load_config.hf_quantizer)

File "G:\fanyi\_internal\transformers\modeling_utils.py", line 4810, in caching_allocator_warmup

_ = torch.empty(int(byte_count // 2), dtype=torch.float16, device=device, requires_grad=False)

torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 516.00 MiB. GPU 0 has a total capacity of 8.00 GiB of which 0 bytes is free. Of the allocated memory 14.00 GiB is allocated by PyTorch, and 26.20 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)
cfg=[TaskCfgVTT]当前工作模式: 翻译视频或音频 批量翻译模式 每批1个
原始输入文件名: E:/sucai/暴发户/成片/25.mp4,
输出结果保存到文件夹: E:/sucai/暴发户/成片/_video_out/25-mp4,
临时文件夹: G:/fanyi/tmp/20288/06e6462f54
已选 清理已存在
已选 启用CUDA加速
未选 降噪
已选 识别说话人,最大说话人数量不限制
语音识别:faster-whisper(本地内置), model_name: large-v3-turbo, 发音语言: 简体中文, 断句方式:默认断句
翻译渠道:DeepSeek,原始语言:简体中文,目标语言:英语, 已选 发送完整字幕
配音渠道:OmniVoice(本地内置), 角色:clone, 配音语言:英语, 已选 二次语音识别
音量:+0%, 语速:+10%, 已选 音频加速, 未选 视频慢速
字幕: 嵌入软字幕
已选 分离人声与背景声, 已选 重新嵌入背景声, 背景音量0.8, 背景声音时长 短于 视频时长时: 拉长(降速播放),存在分离后的纯净人声文件,存在分离后的背景声音文件
代理地址:


=
system:Windows-10-10.0.18363-SP0
version:v4.05
frozen:True
language:zh
root_dir:G:/fanyi

1 Replies

这是显存不足导致 OmniVoice(本地内置) 模型加载失败。你的 GPU 仅有 8GB 显存,但之前运行的 faster-whisper large-v3-turbo 已经占用了大部分空间,OmniVoice 无法继续分配 516MB 的额外内存。

解决方案(按优先级排序):

  1. 关闭 CUDA 加速,改用 CPU 运行 OmniVoice
    进入 菜单 → 工具 → 高级选项 → 通用设置,取消勾选「启用CUDA加速」。这样 OmniVoice 会运行在 CPU 上(速度较慢但可避免显存耗尽)。
    注意:关闭 CUDA 后,语音识别阶段的 faster-whisper 也将使用 CPU,速度会明显下降。若不想影响 faster-whisper,请看方案 2。
  2. 更换更节省显存的配音渠道

    • 改用 Edge-TTS(免费、无需GPU,开箱即用)
    • Qwen3-TTS(本地内置)(显存占用远小于 OmniVoice,支持克隆)
    • 直接在主界面的「Dubbing Channel」下拉框中切换。
  3. 减小语音识别模型尺寸,释放显存
    将 ASR 模型从 large-v3-turbo 降级为 mediumsmall,可显著降低显存占用。修改位置:主界面「ASR Channel」行的模型选择下拉框。
  4. 重启软件 + 设置环境变量再试
    软件关闭后重新打开,有时能释放被 PyTorch 占用的残留显存。如果仍报错,可尝试在系统环境变量中添加:
    PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
    然后重启软件重试(此环境变量可缓解显存碎片问题)。
  5. 增大系统虚拟内存
    确保 Windows 虚拟内存(pagefile.sys)至少设置为 16GB 以上(SSD盘),有助于缓解物理显存不足时的崩溃。

如果以上方法均无法解决,请提供软件版本号(左上角)和 logs/ 目录下最新日志文件的前30行,以便进一步分析。

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