#5483 cfg=TaskCfgSTT(uuid='50d0170e4c', name='D:/张建光/姜胡说/2022年/@姜胡说_20220516_看到_打断_重新设计_执行路径_这很高级_姜胡....mp4', dirname='D:/张建光/

106.35* Posted at: 1 day ago

语音识别阶段出错[阿里FunASR(本地)(本地内置)] CUDA out of memory. Tried to allocate 912.00 MiB. GPU 0 has a total capacity of 4.00 GiB of which 608.65 MiB is free. Of the allocated memory 1.65 GiB is allocated by PyTorch, and 993.45 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables):Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 490, in paraformer
File "D:\download\pyVideoTrans\_internal\modelscope\pipelines\audio\funasr_pipeline.py", line 73, in call

output = self.model(*args, **kwargs)

File "modelscope\models\base\base_model.py", line 37, in call

return self.postprocess(self.forward(*args, **kwargs))

File "D:\download\pyVideoTrans\_internal\modelscope\models\audio\funasr\model.py", line 61, in forward

ou

......
, in run

File "videotrans\recognition\_base.py", line 90, in run

File "videotrans\recognition\_funasr.py", line 61, in _exec

File "videotrans\configure\base.py", line 272, in _new_process

videotrans.configure.excepts.VideoTransError: CUDA out of memory. Tried to allocate 912.00 MiB. GPU 0 has a total capacity of 4.00 GiB of which 608.65 MiB is free. Of the allocated memory 1.65 GiB is allocated by PyTorch, and 993.45 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables):Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 490, in paraformer
File "D:\download\pyVideoTrans\_internal\modelscope\pipelines\audio\funasr_pipeline.py", line 73, in call

output = self.model(*args, **kwargs)

File "modelscope\models\base\base_model.py", line 37, in call

return self.postprocess(self.forward(*args, **kwargs))

File "D:\download\pyVideoTrans\_internal\modelscope\models\audio\funasr\model.py", line 61, in forward

output = self.model.generate(*args, **kwargs)

File "funasr\auto\auto_model.py", line 329, in generate

return self.inference_with_vad(

File "funasr\auto\auto_model.py", line 506, in inference_with_vad

results = self.inference(

File "funasr\auto\auto_model.py", line 381, in inference

res = model.inference(**batch, **kwargs)

File "D:\download\pyVideoTrans\_internal\funasr\models\seaco_paraformer\model.py", line 429, in inference

_, _, us_alphas, us_peaks = self.calc_predictor_timestamp(

File "D:\download\pyVideoTrans\_internal\funasr\models\bicif_paraformer\model.py", line 139, in calc_predictor_timestamp

ds_alphas, ds_cif_peak, us_alphas, us_peaks = self.predictor.get_upsample_timestamp(

File "D:\download\pyVideoTrans\_internal\funasr\models\bicif_paraformer\cif_predictor.py", line 265, in get_upsample_timestamp

output2, (_, _) = self.blstm(output2)

File "torch\nn\modules\module.py", line 1751, in _wrapped_call_impl

return self._call_impl(*args, **kwargs)

File "torch\nn\modules\module.py", line 1762, in _call_impl

return forward_call(*args, **kwargs)

File "torch\nn\modules\rnn.py", line 1124, in forward

result = _VF.lstm(

torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 912.00 MiB. GPU 0 has a total capacity of 4.00 GiB of which 608.65 MiB is free. Of the allocated memory 1.65 GiB is allocated by PyTorch, and 993.45 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)
cfg=TaskCfgSTT(uuid='50d0170e4c', name='D:/张建光/姜胡说/2022年/@姜胡说_20220516_看到_打断_重新设计_执行路径_这很高级_姜胡....mp4', dirname='D:/张建光/姜胡说/2022年', noextname='@姜胡说_20220516_看到_打断_重新设计_执行路径_这很高级_姜胡...', basename='@姜胡说_20220516_看到_打断_重新设计_执行路径_这很高级_姜胡....mp4', ext='mp4', target_dir='D:/download/pyVideoTrans/output/recogn', cache_folder='D:/download/pyVideoTrans/tmp/12240/50d0170e4c', is_cuda=True, source_language=None, source_language_code=None, source_sub=None, source_wav=None, source_wav_output=None, target_language=None, target_language_code=None, target_sub='D:/download/pyVideoTrans/output/recogn/@姜胡说_20220516_看到_打断_重新设计_执行路径_这很高级_姜胡....srt', target_wav=None, target_wav_output=None, detect_language='zh-cn', recogn_type=3, model_name='paraformer-zh', shibie_audio='D:/download/pyVideoTrans/tmp/12240/50d0170e4c/@姜胡说_20220516_看到_打断_重新设计_执行路径_这很高级_姜胡...-1782441178.926296.wav', remove_noise=False, enable_diariz=False, nums_diariz=0, rephrase=0, fix_punc=0)


=
system:Windows-10-10.0.26200-SP0
version:v4.03
frozen:True
language:zh
root_dir:D:/download/pyVideoTrans

1 Replies

这是由于你的显卡显存不足导致的。GPU 0 总容量仅 4GB,当前空闲仅 608 MB,而阿里 FunASR (paraformer-zh) 模型需要额外分配 912 MB,超出了可用范围。

解决方案(按推荐顺序尝试):

  1. 关闭 CUDA 加速,使用 CPU 运行
    在主界面取消勾选 “CUDA加速”,再次执行。速度会慢很多,但能避免显存不足。
  2. 切换为更轻量的本地识别渠道
    发音语言为中文时,改用 faster-whisper(本地),并选择 tinybase 模型,同时在主界面保持不勾选 CUDA(或仍勾选但需极低显存占用)。
    若显存仍不足,请关闭 CUDA 加速。
  3. 降低计算精度(若坚持使用 CUDA)
    进入 菜单 → 工具 → 高级选项 → 语音识别参数,将 计算数据类型 改为 int8float16,并关闭 启用上下文感知
    同时可将 beam_sizebest_of 调为 1。
  4. 检查后台其他程序
    关闭其他占用显存的软件(如浏览器、视频播放器),释放更多显存。

如果以上仍无法解决,建议使用 faster-whisper(本地) + CPU 模式,或考虑升级显卡。

请查阅相关文档:

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: ko-fi.com/jianchang512

Related resource