#7811 语音识别阶段出错[faster-whisper(内置)] mkl_malloc: failed to allocate memory:Traceback (most recent call last): File

2602**b8 Posted at: 2 hours ago

语音识别阶段出错[faster-whisper(内置)] mkl_malloc: failed to allocate memory:Traceback (most recent call last):
File "videotrans\process\stt_faster.py", line 129, in faster_whisper
File "faster_whisper\transcribe.py", line 1851, in restore_speech_timestamps
File "faster_whisper\transcribe.py", line 1190, in generate_segments
File "faster_whisper\transcribe.py", line 1400, in encode
RuntimeError: mkl_malloc: failed to allocate memory

Traceback (most recent call last):

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

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

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

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

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

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

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

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

videotrans.configure.excepts.VideoTransError: mkl_malloc: failed to allocate memory:Traceback (most recent call last):
File "videotrans\process\stt_faster.py", line 129, in faster_whisper
File "faster_whisper\transcribe.py", line 1851, in restore_speech_timestamps
File "faster_whisper\transcribe.py", line 1190, in generate_segments
File "faster_whisper\transcribe.py", line 1400, in encode
RuntimeError: mkl_malloc: failed to allocate memory
[SpeechToText]语音转录: self.out_format='srt',self.copysrt_rawvideo=False,self.spk_insert=False
[TaskCfgSTT]
原始输入文件名: D:/Baasir/Videos/菲律宾/菲律宾.mp3,
输出结果保存到文件夹: D:/win-pyvideotrans-v4.14/output/recogn,
临时文件夹: D:/win-pyvideotrans-v4.14/tmp/19120/317c6eb76e
未启用CUDA加速
已选 降噪
语音识别:faster-whisper(内置), large-v3-turbo 断句方式:默认断句
发音语言:zh
已选 降噪
代理地址:http://127.0.0.1:7897


=
system:Windows-10-10.0.19045-SP0
version:v4.14
frozen:True
language:zh_CN
root_dir:D:/win-pyvideotrans-v4.14

1 Replies

#1 DeepSeek reply at 2 hours ago

核心原因:mkl_malloc: failed to allocate memory 是内存分配失败,即物理内存/虚拟内存不足导致的,与模型本身无关。

从日志看:你未启用CUDA加速,使用的是 faster-whisper large-v3-turbo 模型,并启用了降噪。纯CPU运行 large-v3-turbo 模型需占用大量内存(通常8GB以上),叠加降噪处理,很容易耗尽内存。

解决方案(按优先级依次尝试):

  1. 降低模型尺寸:将 faster-whisper 模型从 large-v3-turbo 换为 medium 或 small,内存占用大幅降低。
  2. 关闭降噪:日志显示你已勾选降噪,会额外占用内存和处理时间,可在 菜单-工具/高级选项 或 设置更多参数 中取消。
  3. 修改计算数据类型:进入 菜单-工具/高级选项-语音识别参数,将 计算数据类型 改为 int8,可显著降低内存占用。
  4. 降低识别精度:将 识别准确度beam_size 和 best_of 都设为 1。
  5. 关闭上下文感知:将高级选项中的 启用上下文感知 设为 False(默认关闭,若开启请关闭)。
  6. 降低并发任务数:进入 菜单-工具/高级选项-通用,将 CPU同时任务数 设为 1(修改后需重启软件)。
  7. 检查虚拟内存/物理内存:确认系统是否有足够可用内存,可关闭其他占用内存的程序后再重试。
  8. 若有N卡:建议正确配置CUDA 12.8 + cuDNN 9.11并启用CUDA加速,将计算负载转移到显存。参考 /gpu 文档。

请查阅相关文档:

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