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

223.74* Posted at: 22 hours ago

mkl_malloc: failed to allocate memory:Traceback (most recent call last):
File "videotrans\process\_stt_faster.py", line 181, 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\only_one.py", line 47, in run
File "videotrans\task\_stage_recogn.py", line 62, in recogn
File "videotrans\recognition\__init__.py", line 205, in run
File "videotrans\recognition\_base.py", line 92, in run
File "videotrans\recognition\_whisper.py", line 38, in _exec
File "videotrans\recognition\_whisper.py", line 124, in _faster
File "videotrans\configure\base.py", line 272, 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 181, 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

cfg=[TaskCfgVTT]当前工作模式: 翻译视频或音频 单视频模式
原始输入文件名: D:/dz-play/old_file/2026-07-19_1349.mp4,
输出结果保存到文件夹: D:/dz-play/out_file/2026-07-19_1349-mp4,
临时文件夹: D:/software/win-pyvideotrans-v4.06-0720/tmp/1652/69f17c7bc0
已选 清理已存在
未选 启用CUDA加速
未选 降噪
语音识别:faster-whisper(本地内置), model_name: small, 发音语言: 英语, 断句方式:默认断句
翻译渠道:Google(免费),原始语言:英语,目标语言:简体中文, 未选 发送完整字幕
配音渠道:Edge-TTS(免费), 角色:Yunyang(Male/CN), 配音语言:简体中文, 未选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 未选 视频慢速
字幕: 嵌入硬字幕
已选 仅输出mp4
代理地址:


=
system:Windows-10-10.0.19045-SP0
version:v4.06
frozen:True
language:zh
root_dir:D:/software/win-pyvideotrans-v4.06-0720

1 Replies

这是由于计算机物理内存不足导致 faster-whisper 在 CPU 模式下分配内存失败。当前模型为 small,在 64 位操作系统上通常需要约 4-6GB 可用内存,若系统剩余内存较小或同时运行其他程序,会触发此错误。

解决方案:

  1. 降低语音识别模型:将 语音识别 的模型从 small 改为 tinybasetiny 模型占用内存约 1GB,base 约 1.5GB,可大幅缓解内存压力。
  2. 关闭其他占用内存的程序:在任务管理器中查看内存使用,关闭不必要的浏览器标签页、大型软件等。
  3. 增加虚拟内存

    • 右键“此电脑” → 属性 → 高级系统设置 → 高级 → 性能设置 → 高级 → 虚拟内存更改。
    • 取消“自动管理所有驱动器的分页文件大小”,选择 C 盘或其它盘,设置为“自定义大小”,初始值和最大值均设为 16000 MB(16GB)以上,点击设置并重启电脑。
  4. 限制 CPU 并发数:进入 菜单 → 工具/选项 → 高级选项 → 通用设置,将 CPU同时任务数 设为 1(修改后需重启软件生效)。
  5. 如果拥有 NVIDIA 显卡:请安装 CUDA 12.8 及 cuDNN 9.11,然后在主界面勾选 CUDA加速,利用 GPU 处理可大幅降低内存占用并提升速度。

请查阅相关文档:

Post Your Reply
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

Dondate via PayPal

Related resource