#3894 TaskCfg(cache_folder='H:/新建文件夹/win-pyvideotrans-v3.92/tmp/13164/9f04bd7889', target_dir='H:/新建文件夹/win-pyvideotrans-v3.92

27.189* Posted at: 1 day ago 👁23

语音识别阶段出错 [faster-whisper(本地)] Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 264, in faster_whisper
File "faster_whisper\transcribe.py", line 586, in _batched_segments_generator
File "faster_whisper\transcribe.py", line 120, in forward
File "faster_whisper\transcribe.py", line 209, in generate_segment_batched
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 106, in run
File "videotrans\task\_speech2text.py", line 156, in recogn
File "videotrans\recognition\__init__.py", line 268, in run
File "videotrans\recognition\_base.py", line 141, in run
File "videotrans\recognition\_overall.py", line 63, in _exec
File "videotrans\recognition\_overall.py", line 142, in _faster
File "videotrans\configure\_base.py", line 291, in _new_process
RuntimeError: Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 264, in faster_whisper
File "faster_whisper\transcribe.py", line 586, in _batched_segments_generator
File "faster_whisper\transcribe.py", line 120, in forward
File "faster_whisper\transcribe.py", line 209, in generate_segment_batched
File "faster_whisper\transcribe.py", line 1400, in encode
RuntimeError: mkl_malloc: failed to allocate memory
TaskCfg(cache_folder='H:/新建文件夹/win-pyvideotrans-v3.92/tmp/13164/9f04bd7889', target_dir='H:/新建文件夹/win-pyvideotrans-v3.92/output/recogn', remove_noise=True, is_separate=False, detect_language='auto', subtitle_language=None, source_language=None, target_language=None, source_language_code=None, target_language_code=None, source_sub=None, target_sub='H:/新建文件夹/win-pyvideotrans-v3.92/output/recogn/91d879a1a99552646c13c7fb5a27c4d4.srt', source_wav=None, source_wav_output=None, target_wav=None, target_wav_output=None, subtitles='', novoice_mp4=None, noextname='91d879a1a99552646c13c7fb5a27c4d4', shibie_audio='H:/新建文件夹/win-pyvideotrans-v3.92/tmp/13164/9f04bd7889/91d879a1a99552646c13c7fb5a27c4d4-1775002782.5472443.wav', targetdir_mp4=None, instrument=None, vocal=None, back_audio=None, background_music=None, app_mode='biaozhun', subtitle_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role=None, copysrt_rawvideo=False, clear_cache=False, translate_type=None, tts_type=None, recogn_type=0, model_name='medium', voice_autorate=False, video_autorate=False, is_cuda=False, name='I:/新建文件夹 (2)/91d879a1a99552646c13c7fb5a27c4d4.mp4', basename='91d879a1a99552646c13c7fb5a27c4d4.mp4', ext='mp4', dirname='I:/新建文件夹 (2)', shound_del_name=None, uuid='9f04bd7889', remove_silent_mid=False, align_sub_audio=True, enable_diariz=False, nums_diariz=0, rephrase=0, only_out_mp4=False, fix_punc=False, recogn2pass=False)


=
system:Windows-10-10.0.19045-SP0
version:v3.97
frozen:True
language:zh
root_dir:H:/新建文件夹/win-pyvideotrans-v3.92

1 Replies

这是由于内存分配失败导致的,具体错误是 mkl_malloc: failed to allocate memory。这表明系统内存或显存不足以加载并运行 faster-whisper 模型。

  1. 降低模型大小:将 faster-whisper(本地) 的模型从 medium 更换为更小的模型,例如 smallbasemedium 模型对内存要求较高。
  2. 关闭降噪:从日志中看到 remove_noise=True,降噪功能会额外消耗内存。尝试取消勾选主界面上的 降噪 选项。
  3. 调整高级设置:进入 菜单 -> 工具 -> 高级选项,在 语音识别参数 区域进行如下调整,以降低内存占用:

    • CUDA数据类型:如果已启用 CUDA,尝试将其从 float32 改为 float16int8
    • 识别准确度beam_size:将值从 5 改为 1
    • 识别准确度best_of:将值从 5 改为 1
    • 启用上下文感知:确保此项为未选中状态。
  4. 检查CUDA加速:从日志 is_cuda=False 看出未启用 GPU 加速。如果你有 NVIDIA 显卡并正确安装了 CUDA 12.8 和 cuDNN,请务必在主界面勾选 CUDA加速 复选框,这会将计算负载从内存转移到显存。
  5. 管理后台程序:关闭其他占用大量内存的软件(如浏览器、游戏),释放系统资源。
  6. 处理较短视频:如果视频文件过长,可以尝试先截取一小段进行测试。

请查阅相关文档:

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.

Related resource