#6943 语音识别阶段出错[Qwen-ASR(内置)] CUDA out of memory. Tried to allocate 1.10 GiB. GPU 0 has a total capacity of 11.94 GiB of which

151.242**1 Posted at: 2 hours ago

语音识别阶段出错[Qwen-ASR(内置)] CUDA out of memory. Tried to allocate 1.10 GiB. GPU 0 has a total capacity of 11.94 GiB of which 176.00 MiB is free. Of the allocated memory 8.94 GiB is allocated by PyTorch, and 1.62 GiB 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\process\stt_qwen.py", line 57, in qwen3asr_fun
File "D:\Tools\win-pyvideotrans-v4.11\_internal\torch\utils\_contextlib.py", line 116, in decorate_context

return func(*args, **kwargs)

File "qwen_asr\inference\qwen3_asr.py", line 383, in transcribe

raw_outputs = self._infer_asr(chunk_ctx, chunk_wavs, chunk_lang)

File "qwen_asr\inference\qwen3_asr.py", line 485, in _infer_asr

return self._infer_asr_transformers(contexts, wavs,

......
n forward

hidden_states, _ = self.self_attn(

File "D:\Tools\win-pyvideotrans-v4.11\_internal\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl

return self._call_impl(*args, **kwargs)

File "D:\Tools\win-pyvideotrans-v4.11\_internal\torch\nn\modules\module.py", line 1762, in _call_impl

return forward_call(*args, **kwargs)

File "D:\Tools\win-pyvideotrans-v4.11\_internal\transformers4576\utils\deprecation.py", line 172, in wrapped_func

return func(*args, **kwargs)

File "qwen_asr\core\transformers_backend\modeling_qwen3_asr.py", line 204, in forward

attn_output, attn_weights = attention_interface(

File "D:\Tools\win-pyvideotrans-v4.11\_internal\transformers4576\integrations\sdpa_attention.py", line 96, in sdpa_attention_forward

attn_output = torch.nn.functional.scaled_dot_product_attention(

torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 1.10 GiB. GPU 0 has a total capacity of 11.94 GiB of which 176.00 MiB is free. Of the allocated memory 8.94 GiB is allocated by PyTorch, and 1.62 GiB 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)
[SpeechToText]语音转录: self.out_format='srt',self.copysrt_rawvideo=True,self.spk_insert=False
[TaskCfgSTT]
原始输入文件名: D:/A-H-X/AHX/A/FAプロ/AOFA&AOFR 001-048(全高清)/AOFR-045 FA-289 懐かしきFAポルノ 青春SEX激情篇 初恋残酷物語 【河合ゆかり,織本さくら,伊藤百合,秋山礼子】(自译)/AOFR-045 懐かしきFAポルノ 青春SEX激情篇 初恋残酷物語.wmv,
输出结果保存到文件夹: C:/Users/Administrator/Downloads/Compressed/win-pyvideotrans-v4.11/output/recogn,
临时文件夹: D:/Tools/win-pyvideotrans-v4.11/tmp/5832/e2a6adc6c4
已启用CUDA加速
未选 降噪
语音识别:Qwen-ASR(内置), 0.6B 断句方式:默认断句
发音语言:ja
未选 降噪
代理地址:http://127.0.0.1:7890


=
system:Windows-10-10.0.26100-SP0
version:v4.11
frozen:True
language:zh
root_dir:D:/Tools/win-pyvideotrans-v4.11

1 Replies

#1 DeepSeek reply at 2 hours ago

这是显存不足导致的。你的显卡总容量约 12GB,而 Qwen-ASR 在 CUDA 加速下运行 0.6B 模型时已占用约 9GB,剩余可用仅 176MB,模型在推理过程中需要额外分配内存时无法满足,因而报错。

可依次尝试以下方法:

  1. 关闭所有其他占用显卡显存的程序(如浏览器、游戏、其他 AI 工具、桌面特效等),确保无残留显存占用。
  2. 进入 菜单 → 工具 → 高级选项 → 语音识别参数

    • 计算数据类型 改为 int8(最省显存,精度略有下降)。
    • 识别准确度 beam_sizebest_of 都设为 1
    • 取消勾选 启用上下文感知
  3. 若仍不足,可将语音识别渠道更换为显存占用更低的模型,例如 faster-whisper(内置)smallbase 模型。
  4. 也可尝试按报错提示设置环境变量 PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True 以避免显存碎片问题,但前提是显存余量充足,否则只是缓解。

注意:本地 AI 模型在 12GB 显存下运行大模型本身资源紧张,属正常现象。如果上述方法均无效,请提供软件安装目录下 logs/ 文件夹中最新的日志文件(复制底部约30行报错信息)以便进一步分析。

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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

Related resource