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

119.118**0 Posted at: 2 hours ago

语音识别阶段出错[openai-whisper(内置)] Unable to allocate 597. MiB for an array with shape (156372651,) and data type float32:Traceback (most recent call last):
File "videotrans\process\stt_openai.py", line 65, in openai_whisper
File "whisper\transcribe.py", line 139, in transcribe
File "whisper\audio.py", line 140, in log_mel_spectrogram
File "whisper\audio.py", line 62, in load_audio
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 597. MiB for an array with shape (156372651,) 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 65, in recogn

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

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

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

File "videotrans\recognition\_whisper.py", line 81, in _openai

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

videotrans.configure.excepts.VideoTransError: Unable to allocate 597. MiB for an array with shape (156372651,) and data type float32:Traceback (most recent call last):
File "videotrans\process\stt_openai.py", line 65, in openai_whisper
File "whisper\transcribe.py", line 139, in transcribe
File "whisper\audio.py", line 140, in log_mel_spectrogram
File "whisper\audio.py", line 62, in load_audio
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 597. MiB for an array with shape (156372651,) and data type float32

self.cfg=[TaskCfgVTT]当前工作模式: 转录并翻译字幕
原始输入文件名: J:/1.最新下载/人妖和女/已下载/字母/NVH-066/NVH-066_______________.mp4,
输出结果保存到文件夹: J:/1.最新下载/人妖和女/已下载/_video_out/字母/NVH-066_______________-mp4,
临时文件夹: D:/软件/视频相关/win-pyvideotrans-v4.11/tmp/2936/ccd8cd57de
已选 清理已存在
已启用CUDA加速
未选 降噪
语音识别:openai-whisper(内置), large-v3-turbo, 发音语言: 日语, 断句方式:默认断句
翻译渠道:微软(免费),原始语言:日语,目标语言:简体中文, 已选 发送完整字幕
输出字幕格式: 单字幕


=
system:Windows-10-10.0.19041-SP0
version:v4.12
frozen:True
language:zh
root_dir:D:/软件/视频相关/win-pyvideotrans-v4.11

1 Replies

#1 DeepSeek reply at 2 hours ago

这是因为输入音频数据过大(约 597 MiB 的 float32 数组超出可用内存),openai-whisper 在加载音频时发生内存分配失败(_ArrayMemoryError)。

  1. 改用 faster-whisper(内置) 渠道,它对内存占用更友好,是默认推荐渠道。
  2. 若仍用 openai-whisper,请关闭其他占用内存的程序释放内存。
  3. 降低模型尺寸:将 large-v3-turbo 更换为 mediumsmall 等更小模型。
  4. 若已启用 CUDA 加速,请进入 菜单 → 工具 → 高级选项 → 语音识别参数,将 计算数据类型 改为 float16int8
  5. beam_sizebest_of 调低(如设为 1),减少显存/内存占用。
  6. 确认虚拟内存(页面文件)充足,或关闭其他占用大量内存的软件后重试。

请查阅相关文档:

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