#8565 mkl_malloc: failed to allocate memory,Traceback (most recent call last): File

123.161**1 Posted at: 1 hour ago

mkl_malloc: failed to allocate memory,Traceback (most recent call last):
File "videotrans\process\stt_faster.py", line 54, in _create_model
File "faster_whisper\transcribe.py", line 689, in init
RuntimeError: mkl_malloc: failed to allocate memory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\process\stt_faster.py", line 84, in faster_whisper
File "videotrans\process\stt_faster.py", line 77, in _create_model
File "videotrans\process\stt_faster.py", line 54, in _create_model
File "faster_whisper\transcribe.py", line 689, in init
RuntimeError: mkl_malloc: failed to allocate memory

Traceback (most recent call last):
File "videotrans\task\only_one.py", line 71, in run
File "videotrans\task\_stage_recogn.py", line 64, 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: mkl_malloc: failed to allocate memory,Traceback (most recent call last):
File "videotrans\process\stt_faster.py", line 54, in _create_model
File "faster_whisper\transcribe.py", line 689, in init
RuntimeError: mkl_malloc: failed to allocate memory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\process\stt_faster.py", line 84, in faster_whisper
File "videotrans\process\stt_faster.py", line 77, in _create_model
File "videotrans\process\stt_faster.py", line 54, in _create_model
File "faster_whisper\transcribe.py", line 689, in init
RuntimeError: mkl_malloc: failed to allocate memory

trk=[TransCreate]: uuid='ca21a95693', proxy_str=None, cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: D:/越轨西语/22/22pin.mp4,
输出结果保存到文件夹: D:/越轨西语/22/22pin-mp4,
临时文件夹: D:/win-pyvideotrans-v4.17-1027/tmp/34620/ca21a95693
已选 清理已存在
未启用CUDA加速
语音识别:faster-whisper(内置), medium, 发音语言: 西班牙语, , 数据类型:int8
发音语言和目标语言相同,不翻译字幕
未选 配音角色,不进行配音
字幕: 嵌入硬字幕 , precent=4, hasend=False, should_recogn=True, should_trans=False, should_dubbing=False, should_hebing=True, is_copy_video=True, video_codec_num=264, ignore_align=False, is_audio_trans=False, clone_ref='', should_recogn2=False, do_diarize=True
video_duration_ms=105800


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

1 Replies

#1 DeepSeek reply at 1 hour ago

底层原因是内存不足:未启用 CUDA 加速,faster-whisper 在 CPU 上用 int8 加载 medium 模型时,进程向内存申请空间失败(mkl_malloc 分配失败),通常是物理内存被占用过多或本身不够。

按以下顺序排查:

  1. 降低模型尺寸(最直接):把语音识别模型从 medium 换成 small 或 base,medium 需约 5GB 内存,small 约 2GB。
  2. 释放内存:关闭浏览器、其他大型程序,确保空闲内存充足;重启软件后再试。
  3. 有 NVIDIA 显卡就启用 GPU:勾选主界面 CUDA加速(需 CUDA 12.8 + cuDNN 9.11),模型走显存可大幅降低内存压力。
  4. 降低计算资源占用:菜单-工具/选项-高级选项-语音识别参数 中把 计算数据类型 保持 int8,并将 识别准确度beam_size、best_of 调为 1,启用上下文感知 设为否。
  5. 限制并发:高级选项-通用设置 中 CPU同时任务数 设为 1、GPU同时任务数 设为 1(修改后重启生效),避免多进程同时加载模型把内存吃满。

若以上操作后仍报同一错误,说明机器物理内存确实不足以加载该模型,只能继续使用更小模型(如 base 或 tiny)。

请查阅相关文档:

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