#6944 语音识别阶段出错[faster-whisper(内置)] bad allocation:Traceback (most recent call last): File

240e**c4a4 Posted at: 2 hours ago

语音识别阶段出错[faster-whisper(内置)] bad allocation:Traceback (most recent call last):
File "videotrans\process\stt_faster.py", line 184, in faster_whisper
File "faster_whisper\transcribe.py", line 1851, in restore_speech_timestamps
File "faster_whisper\transcribe.py", line 1213, in generate_segments
File "faster_whisper\transcribe.py", line 1446, in generate_with_fallback
MemoryError: bad allocation

Traceback (most recent call last):

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

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

File "videotrans\task\_stage_recogn.py", line 63, in recogn

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

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

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

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

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

videotrans.configure.excepts.VideoTransError: bad allocation:Traceback (most recent call last):
File "videotrans\process\stt_faster.py", line 184, in faster_whisper
File "faster_whisper\transcribe.py", line 1851, in restore_speech_timestamps
File "faster_whisper\transcribe.py", line 1213, in generate_segments
File "faster_whisper\transcribe.py", line 1446, in generate_with_fallback
MemoryError: bad allocation
[TransCreate]翻译视频: self.is_copy_video=True,self.video_codec_num=264,self.is_audio_trans=False,self.video_info={'video_fps': 30.0, 'r_frame_rate': 30.0, 'video_codec_name': 'h264', 'audio_codec_name': 'aac', 'width': 1920, 'height': 1080, 'time': 8102333, 'streams_len': 2, 'streams_audio': 1, 'video_streams': 1, 'color': 'yuv420p'}
[TaskCfgVTT]当前工作模式: 翻译视频 批量翻译模式
原始输入文件名: D:/3632314642860791_胡伯曼博士/如何克服内在阻力 _ Huberman 实验室.mp4,
输出结果保存到文件夹: D:/_video_out/3632314642860791_胡伯曼博士/如何克服内在阻力 _ Huberman 实验室-mp4,
临时文件夹: D:/sp/tmp/9276/1d87a98785
未选 清理已存在
已启用CUDA加速
未选 降噪
已选 识别说话人,最大说话人数量7
语音识别:faster-whisper(内置), large-v3, 发音语言: 英语, 断句方式:默认断句
翻译渠道:Google(免费),原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
配音渠道:Edge-TTS(免费), 角色:Xiaoyi(Female/CN), 配音语言:简体中文, 已选 二次语音识别
音量:+0%, 语速:+20%, 已选 音频加速, 已选 视频慢速
字幕: 嵌入硬字幕
已选 仅输出mp4


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

1 Replies

#1 DeepSeek reply at 2 hours ago

这是内存分配失败(bad allocation),本质是系统内存或显卡显存不足以承载 faster-whisper large-v3 模型的运行。large-v3 基础运行需约 8GB 显存,且你还开启了说话人分离(最多7人),进一步推高了内存需求。

按以下顺序调整:

  1. 更换较小的模型:将语音识别模型从 large-v3 改为 large-v3-turbo(速度更快、显存约6GB),或 medium / small
  2. 降低计算数据类型:进入 菜单 -> 工具 -> 高级选项 -> 语音识别参数,将 计算数据类型 改为 float16(有N卡)或 int8(最省内存)。
  3. 减小搜索深度:将 识别准确度beam_sizebest_of 都改为 1
  4. 关闭上下文感知:取消勾选 启用上下文感知
  5. 关闭说话人分离:若当前不需要标记说话人,先取消 设置更多参数 中的 识别说话人,降低内存负担。
  6. 检查模型完整性:若此前自动下载曾中断,模型文件可能损坏,删除 软件目录/models/models--Systran--faster-whisper-large-v3 后重新运行,让软件重新下载。

若调整后仍报错,请提供你的显卡型号、显存容量和物理内存大小,以便进一步判断。

请查阅相关文档:

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