#2936 TaskCfg(cache_folder='D:/Programs/win-pyvideotrans-v3.95/tmp/18960/ed7790d61b', target_dir='D:/Programs/win-pyvideotrans

60.28* Posted at: 2 hours ago 👁9

语音识别阶段出错 [faster-whisper(本地)] Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 177, in faster_whisper
File "faster_whisper\transcribe.py", line 689, in init
RuntimeError: CUDA failed with error out of 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 276, in run
File "videotrans\recognition\_base.py", line 140, 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 276, in _new_process
RuntimeError: Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 177, in faster_whisper
File "faster_whisper\transcribe.py", line 689, in init
RuntimeError: CUDA failed with error out of memory
TaskCfg(cache_folder='D:/Programs/win-pyvideotrans-v3.95/tmp/18960/ed7790d61b', target_dir='D:/Programs/win-pyvideotrans-v3.95/output/recogn', remove_noise=False, is_separate=False, detect_language='ja', subtitle_language=None, source_language=None, target_language=None, source_language_code=None, target_language_code=None, source_sub=None, target_sub='D:/Programs/win-pyvideotrans-v3.95/output/recogn/111.srt', source_wav=None, source_wav_output=None, target_wav=None, target_wav_output=None, subtitles='', novoice_mp4=None, noextname='111', shibie_audio='D:/Programs/win-pyvideotrans-v3.95/tmp/18960/ed7790d61b/111-1769505029.997487.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, cuda=True, name='C:/Users/DAWN/Desktop/111.mp4', basename='111.mp4', ext='mp4', dirname='C:/Users/DAWN/Desktop', shound_del_name=None, uuid='ed7790d61b', 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.22621-SP0
version:v3.95
frozen:True
language:zh
root_dir:D:/Programs/win-pyvideotrans-v3.95

1 Replies

这是由于显存不足导致的。在使用 faster-whisper 本地模型进行语音识别时,加载模型所需显存超过了显卡的可用显存。

解决方案

  1. 降低模型大小:在语音识别设置中,将模型从 medium 更换为更小的模型,例如 smallbasemedium 模型对显存要求较高。
  2. 启用量化:在“高级选项” -> “语音识别参数”中,将“量化级别”设置为 int8,这可以显著减少模型对显存的需求。
  3. 调整识别参数:在“高级选项” -> “语音识别参数”中,将 beam_size 参数从默认的 5 降低到 2 或 1,以减少计算量。
  4. 关闭其他占用显存的程序:确保在运行 pyVideoTrans 时,没有其他大型软件(如游戏、其他AI应用)同时占用显卡。
  5. 使用CPU模式:如果显卡显存确实太小(例如小于4GB),可以临时在语音识别设置中取消勾选“使用CUDA加速”,让模型在CPU上运行(速度会慢很多)。

操作步骤

  • 打开 pyVideoTrans,进入“设置”或“语音识别”配置界面。
  • 将“模型”从 medium 改为 small
  • 进入“菜单” -> “工具” -> “高级选项”,找到“语音识别参数”部分。
  • 将“量化级别”设置为 int8,将“beam_size”设置为 2。
  • 保存设置并重新运行语音识别任务。

请查阅相关文档:

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