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

2a09**2 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 139, in faster_whisper
File "faster_whisper\transcribe.py", line 1851, in restore_speech_timestamps
File "faster_whisper\transcribe.py", line 1279, in generate_segments
File "faster_whisper\transcribe.py", line 1590, in add_word_timestamps
File "faster_whisper\transcribe.py", line 1709, in find_alignment
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 101, in process_task

File "videotrans\task\_stage_recogn.py", line 63, in recogn

File "videotrans\recognition\__init__.py", line 141, 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 139, in faster_whisper
File "faster_whisper\transcribe.py", line 1851, in restore_speech_timestamps
File "faster_whisper\transcribe.py", line 1279, in generate_segments
File "faster_whisper\transcribe.py", line 1590, in add_word_timestamps
File "faster_whisper\transcribe.py", line 1709, in find_alignment
RuntimeError: mkl_malloc: failed to allocate memory
trk=[TransCreate]: uuid='3f4243d4f9', proxy_str=None, cfg=[TaskCfgVTT]当前工作模式: 翻译视频 批量翻译模式
原始输入文件名: D:/youtube素材/mp4/mp4/The Design Evolution of Legendary Pokemon Trios [lQyitKae4cc] [1920x1080].mp4,
输出结果保存到文件夹: C:/Users/AOC/Desktop/The Design Evolution of Legendary Pokemon Trios [lQyitKae4cc] [1920x1080]-mp4,
临时文件夹: D:/AiTools/PyVideoTrans/tmp/16544/3f4243d4f9
未选 清理已存在
未启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), large-v3-turbo, 发音语言: 英语,
翻译渠道:Google(免费),原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
配音渠道:Edge-TTS(免费), 角色:Xiaoxiao(Female/CN), 配音语言:简体中文, 未选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 未选 视频慢速
已选 移除每条字幕配音开头和结尾静音缓冲
静音移除力度: default
字幕: 不嵌入字幕 , precent=4, hasend=False, should_recogn=True, should_trans=True, should_dubbing=True, 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=False


=
system:Windows-10-10.0.19045-SP0
version:v4.16
frozen:True
language:zh_CN
root_dir:D:/AiTools/PyVideoTrans

1 Replies

#1 DeepSeek reply at 2 hours ago

这是内存分配失败导致的,通常是因为系统可用物理内存不足,或磁盘空间不足导致虚拟内存无法分配。错误发生在 faster-whisper 语音识别过程中(mkl_malloc: failed to allocate memory),意味着底层 MKL 数学库尝试申请内存时被操作系统拒绝。

解决方法(按顺序尝试)

  1. 释放物理内存
    关闭其他大型软件(浏览器、游戏、设计软件等),确保系统至少有 8-16GB 可用内存。当前使用 large-v3-turbo 模型且在纯 CPU 模式下运行,内存占用会比较高。
  2. 检查磁盘空间
    虚拟内存依赖磁盘空间。请检查以下两个位置是否有足够空间(建议至少保留 20GB 以上):

    • 软件临时目录:D:/AiTools/PyVideoTrans/tmp
    • 系统盘 C 盘
  3. 降低模型规格
    在主界面语音识别渠道(faster-whisper)中,将模型从 large-v3-turbo 改为 medium 或 small,大幅减少内存需求。
  4. 修改计算数据类型
    打开 菜单 -> 工具/选项 -> 高级选项 -> 语音识别参数,将 计算数据类型 改为 int8,可显著降低内存占用。
  5. 限制同时任务数
    在 高级选项 -> 通用设置 中,将 CPU同时任务数 设为 1,避免多个任务同时抢占内存。
  6. 重启软件或电脑后重试
    如果以上方法无效,很可能存在内存碎片或资源泄漏,重启后再试。

如果仍然失败,请提供系统物理内存大小、可用内存情况,以及 logs/ 目录下最新日志的完整报错信息,以便进一步分析。

请查阅相关文档:

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