#7058 语音识别阶段出错[faster-whisper(内置)] Unable to allocate 757. MiB for an array with shape (198373024,) and data type float32:Trac

240e**290b Posted at: 2 hours ago

语音识别阶段出错[faster-whisper(内置)] Unable to allocate 757. MiB for an array with shape (198373024,) and data type float32:Traceback (most recent call last):
File "videotrans\process\stt_faster.py", line 164, in faster_whisper
File "faster_whisper\transcribe.py", line 916, in transcribe
File "faster_whisper\feature_extractor.py", line 211, in call
File "numpy\lib\arraypad.py", line 798, in pad
File "numpy\lib\arraypad.py", line 114, in _pad_simple
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 757. MiB for an array with shape (198373024,) and data type float32

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: Unable to allocate 757. MiB for an array with shape (198373024,) and data type float32:Traceback (most recent call last):
File "videotrans\process\stt_faster.py", line 164, in faster_whisper
File "faster_whisper\transcribe.py", line 916, in transcribe
File "faster_whisper\feature_extractor.py", line 211, in call
File "numpy\lib\arraypad.py", line 798, in pad
File "numpy\lib\arraypad.py", line 114, in _pad_simple
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 757. MiB for an array with shape (198373024,) and data type float32
[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': 12492433, 'streams_len': 2, 'streams_audio': 1, 'video_streams': 1, 'color': 'yuv420p'}
[TaskCfgVTT]当前工作模式: 翻译视频 批量翻译模式
原始输入文件名: D:/py-/bs/如何增强你的免疫系统 _ Huberman 实验室.mp4,
输出结果保存到文件夹: D:/py-/如何增强你的免疫系统 _ Huberman 实验室-mp4,
临时文件夹: D:/sp/tmp/2460/b998078a1b
已选 清理已存在
已启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), large-v3, 发音语言: 英语, 断句方式:默认断句
翻译渠道:Google(免费),原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
配音渠道:Edge-TTS(免费), 角色:Yunyang(Male/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

这是内存(RAM/显存)不足导致的分配失败。faster-whisper 的 large-v3 模型本身需要约 8GB 显存,且会额外消耗系统内存用于特征数组(float32 数组)。当前系统无法分配 757 MiB 内存,说明可用内存已耗尽。

请按以下顺序操作:

  1. 降低识别模型:在语音识别渠道中,将模型从 large-v3 改为 large-v3-turbo(速度与质量兼顾)或 small / mediumlarge-v3 对显存/内存要求最高。
  2. 降低计算数据类型:进入 菜单 → 工具 → 高级选项 → 语音识别参数,将 计算数据类型 设为 int8(最省内存)或 float16(显卡推荐)。
  3. 降低识别精度参数:在同一高级选项中,将 识别准确度beam_size识别准确度best_of 均设为 1
  4. 关闭上下文感知:取消勾选高级选项中的 启用上下文感知(可显著降低内存占用)。
  5. 释放系统资源:关闭其他占用内存的大程序,确保至少留有 8~12GB 可用内存。
  6. 尝试关闭 CUDA 加速:如果上述操作后仍报错,可先取消勾选主界面的 CUDA加速,改用 CPU 运行(速度会大幅变慢,但可验证是否为显存不足)。

注意:你的视频文件名包含中文、空格和特殊符号,虽不是本错误的直接原因,但建议将该视频移动到纯英文路径(如 D:/video/test.mp4)再试,以避免后续 ffmpeg 命令解析出错。

请查阅相关文档:

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