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

129.153**1 Posted at: 1 day ago

mkl_malloc: failed to allocate memory:Traceback (most recent call last):
File "videotrans\process\stt_faster.py", line 130, 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 70, in run
File "videotrans\task\_stage_recogn.py", line 65, in recogn
File "videotrans\recognition\__init__.py", line 228, in run
File "videotrans\recognition\_base.py", line 97, in run
File "videotrans\recognition\_whisper.py", line 41, in _exec
File "videotrans\recognition\_whisper.py", line 130, 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 130, 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]当前工作模式: 翻译视频 单视频模式
原始输入文件名: C:/Users/zhang/Downloads/YTDown.com_YouTube_Lecture-1-Course-Introduction-MIT-How-to_Media_Xm2crsD5ngA_001_1080p.mp4,
输出结果保存到文件夹: C:/Users/zhang/Downloads/_video_out/YTDown.com_YouTube_Lecture-1-Course-Introduction-MIT-How-to_Media_Xm2crsD5ngA_001_1080p-mp4,
临时文件夹: D:/win-pyvideotrans-v4.12/tmp/32564/a4234617ba
已选 清理已存在
未启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), large-v3-turbo, 发音语言: 英语, 断句方式:LLM重新断句
翻译渠道:DeepSeek,原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
未选 配音角色,不进行配音
字幕: 嵌入硬字幕
已选 仅输出mp4
代理地址:http://127.0.0.1:7897


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

1 Replies

#1 DeepSeek reply at 1 day ago

这是系统内存(物理内存或虚拟内存)不足导致的分配失败。

你当前使用 faster-whisper(内置) + large-v3-turbo 模型,且未启用 CUDA 加速,纯 CPU 运行,内存消耗较高。错误发生在语音识别的 restore_speech_timestamps(时间戳恢复)阶段,此时一次性加载了较大音频片段。

建议操作(按优先级排序)

  1. 降低模型尺寸
    将语音识别模型从 large-v3-turbo 改为 mediumsmall(在语音识别渠道的模型下拉框中切换)。medium 内存占用约5GB,small 约2GB,显著缓解内存压力。
  2. 释放系统内存
    关闭所有无关程序(浏览器、大型软件),并检查系统虚拟内存是否已开启且足够大。

    • 右键“此电脑” → 属性 → 高级系统设置 → 性能设置 → 高级 → 虚拟内存,确保“自动管理”或手动分配至少 16GB。
  3. 调整高级选项中的识别参数
    进入 菜单 → 工具 → 高级选项 → 语音识别参数

    • 计算数据类型 改为 int8(CPU 下最省内存)
    • 识别准确度beam_size 改为 1
    • 识别准确度best_of 改为 1
    • 取消勾选 启用上下文感知
    • 最长语音持续(秒) 调小(例如 10),使每次处理更短的音频片段,减少单次内存峰值
  4. 若你有 NVIDIA 独立显卡
    建议配置 CUDA 12.8 + cuDNN 9.11 后,在主界面勾选 启用CUDA加速。GPU 模式不仅速度更快,且内存占用远低于纯 CPU。
  5. 检查模型文件是否完整
    若模型文件下载不完整也可能触发此类错误。可删除 models/models--mobiuslabsgmbh--faster-whisper-large-v3-turbo 文件夹,重新自动下载。

若以上操作后仍报错,请提供软件安装目录下 logs/ 文件夹中最新的日志文件(复制底部约30行报错信息),以便进一步分析。

请查阅相关文档:

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