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

240e**f45 Posted at: 2 hours ago

语音识别阶段出错[faster-whisper(内置)] Unable to allocate 695. MiB for an array with shape (182129152,) 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 891, in transcribe
File "faster_whisper\vad.py", line 229, in collect_chunks
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 695. MiB for an array with shape (182129152,) 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 695. MiB for an array with shape (182129152,) 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 891, in transcribe
File "faster_whisper\vad.py", line 229, in collect_chunks
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 695. MiB for an array with shape (182129152,) 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': 14033500, 'streams_len': 2, 'streams_audio': 1, 'video_streams': 1, 'color': 'yuv420p'}
[TaskCfgVTT]当前工作模式: 翻译视频 批量翻译模式
原始输入文件名: D:/py-/bs/P0-将痛苦与创伤转化为创造性的表达 _ Huberman 实验室.mp4,
输出结果保存到文件夹: D:/py-/P0-将痛苦与创伤转化为创造性的表达 _ Huberman 实验室-mp4,
临时文件夹: D:/sp/tmp/6568/53e9eabc03
已选 清理已存在
已启用CUDA加速
未选 降噪
语音识别: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

此报错为系统内存(CPU RAM)分配失败,而非GPU显存不足。Unable to allocate 695. MiB for an array with shape (182129152,) 表示 numpy 在申请约 695MB 内存时失败,根本原因是视频时长过长(Huberman 实验室播客通常1-2小时)+ 当前 large-v3 模型 + 整段音频缓冲导致可用内存不足。

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

  1. 降低模型尺寸:将语音识别模型从 large-v3 改为 mediumsmall。large-v3 对长视频的内存需求极高。
  2. 更改计算数据类型:进入 菜单 → 工具 → 高级选项 → 语音识别参数,将 计算数据类型 从默认改为 int8(最省内存)或 float16(适合 GPU)。
  3. 减小搜索深度:将 识别准确度beam_size识别准确度best_of 均设为 1
  4. 关闭上下文感知:在高级选项中将 启用上下文感知 取消勾选。
  5. 设置 GPU 同时任务数为 1:进入 高级选项 → 通用设置 → GPU同时任务数,设为 1(需重启软件生效)。
  6. 关闭其他占用内存的应用:确保处理时系统有足够的空闲内存(建议至少 16GB)。
  7. 若仍失败:可暂时关闭 CUDA 加速(不勾选),使用 CPU 处理——虽然速度慢,但不会因 CPU 内存不足而直接崩溃(前提是系统内存足够)。
注意:你的视频文件名包含中文、空格和特殊符号(P0-将痛苦与创伤转化为创造性的表达 _ Huberman 实验室.mp4),且输出路径也在非默认位置。虽然这不是本次报错的直接原因,但为长期稳定,建议将视频移至纯英文短路径下(如 D:/video/)并重命名为简单文件名(如 test.mp4)。

请查阅相关文档:

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