#8656 语音识别阶段出错[faster-whisper(内置)] Unable to allocate 8.09 MiB for an array with shape (2121387,) and data type float32:Traceb

211.142**3 Posted at: 2 hours ago

语音识别阶段出错[faster-whisper(内置)] Unable to allocate 8.09 MiB for an array with shape (2121387,) and data type float32:Traceback (most recent call last):
File "videotrans\process\stt_faster.py", line 121, in faster_whisper
File "faster_whisper\transcribe.py", line 876, in transcribe
File "faster_whisper\audio.py", line 69, in decode_audio
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 8.09 MiB for an array with shape (2121387,) and data type float32

Traceback (most recent call last):

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

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

File "videotrans\task\speech2text.py", line 96, in recogn

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

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

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

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

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

videotrans.configure.excepts.VideoTransError: Unable to allocate 8.09 MiB for an array with shape (2121387,) and data type float32:Traceback (most recent call last):
File "videotrans\process\stt_faster.py", line 121, in faster_whisper
File "faster_whisper\transcribe.py", line 876, in transcribe
File "faster_whisper\audio.py", line 69, in decode_audio
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 8.09 MiB for an array with shape (2121387,) and data type float32
trk=[SpeechToText]: uuid='bbdc768073', proxy_str='http://127.0.0.1:12000', cfg=[TaskCfgSTT]
原始输入文件名: E:/视频/2026-11-04 18-52-33.mp4,
输出结果保存到文件夹: E:/fanyi/output/recogn,
临时文件夹: E:/fanyi/tmp/19052/bbdc768073
未启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), large-v3-turbo
发音语言:en
未选 降噪
代理地址:http://127.0.0.1:12000, precent=1, hasend=False, should_recogn=True, should_trans=False, should_dubbing=False, should_hebing=False, out_format='txt', copysrt_rawvideo=False, spk_insert=True


=
system:Windows-10-10.0.19045-SP0
version:v4.17
frozen:True
language:zh_CN
root_dir:E:/fanyi

1 Replies

#1 DeepSeek reply at 2 hours ago

这不是显存问题,而是系统内存(RAM)不足——numpy.core._exceptions._ArrayMemoryError: Unable to allocate 8.09 MiB 表示 faster-whisper 在 decode_audio 阶段要把整段音频解码为 float32 数组读入内存,但此时连 8MB 都申请不到,说明物理内存已被耗尽(或虚拟内存/页面文件不足)。

日志显示:未启用CUDA加速、large-v3-turbo 模型在纯 CPU 下运行,模型本身就要占用数 GB 内存,叠加长音频解码后极易爆内存。

排查与解决(按顺序尝试):

  1. 先看内存占用:打开任务管理器→性能→内存,确认是否已接近 100%。关闭浏览器、其他翻译任务、其他 sp.exe 实例等占用内存的程序后重试。
  2. 调大虚拟内存(页面文件):Windows 设置→系统→关于→高级系统设置→性能设置→高级→虚拟内存→更改,取消"自动管理",为软件所在盘(E:)或系统盘设置 8192MB~16384MB 的自定义大小,重启后重试。
  3. 降低模型尺寸:把 large-v3-turbo 换成 medium 或 small,内存占用会明显下降(精度略降)。
  4. 有 NVIDIA 显卡请勾选 CUDA加速:把推理放到显存上,可大幅减少内存压力(需 CUDA 12.8 + cuDNN 9)。
  5. 视频过长时先分段:若该 mp4 时长很长(如 1 小时以上),先用 菜单-工具-音视频格式转换 或剪辑工具切分为多个短片段分别处理。
  6. 检查该视频音轨是否异常:文件名为 2026-11-04 18-52-33.mp4,若为录屏/监控类文件,音轨时长信息可能损坏(例如标称时长远超实际),decode_audio 会按标称时长申请巨大数组。可先用播放器或 ffmpeg 转码为普通 wav/mp3 测试:ffmpeg -i 输入.mp4 -vn -ac 1 -ar 16000 test.wav。
  7. 确认 E: 盘剩余空间充足:临时目录为 E:/fanyi/tmp/19052/bbdc768073,磁盘写满也会引发各类异常,建议保留 10GB 以上余量。
  8. 若上述处理后仍复现,请提供处理该视频时的任务管理器内存占用截图,以及 logs/ 目录下当日日志底部约 50 行内容。

请查阅相关文档:

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