#2025 TaskCfg(cache_folder='C:/Users/Administrator/Documents/11/tmp/4696/acac0fcd6a', target_dir='/192.168.50.88/hh日本🇯🇵-2/1111

188.253* Posted at: 18 hours ago 👁14

语音识别阶段出错:[openai-whisper(本地)] 运行时错误:Traceback (most recent call last):
File "videotrans\process\_overall.py", line 49, in run
File "whisper\transcribe.py", line 295, in transcribe
File "whisper\transcribe.py", line 201, in decode_with_fallback
File "torch\utils\_contextlib.py", line 116, in decorate_context

return func(*args, **kwargs)

File "whisper\decoding.py", line 824, in decode
File "torch\utils\_contextlib.py", line 116, in decorate_context

return func(*args, **kwargs)

File "whisper\decoding.py", line 737, in run
File "whisper\decoding.py", line 703, in _main_loop
File "whisper\decoding.py", line 283, in update
File "torch\distributions\categorical.py", line 73, in init

super().__init__(batch_shape, validate_args=validate_args)

File "torch\distributions\distribution.py", line 72, in init

raise ValueError(

ValueError: Expected parameter logits (Tensor of shape (1, 51866)) of distribution Categorical(logits: torch.Size([1, 51866])) to satisfy the constraint IndependentConstraint(Real(), 1), but found invalid values:
tensor([[nan, nan, nan, ..., nan, nan, nan]], device='cuda:0')
:
Traceback (most recent call last):
File "videotrans\task\job.py", line 113, in run
File "videotrans\task\trans_create.py", line 365, in recogn
File "videotrans\recognition\__init__.py", line 239, in run
File "videotrans\recognition\_base.py", line 80, in run
File "videotrans\recognition\_overall.py", line 182, in _exec
RuntimeError: Traceback (most recent call last):
File "videotrans\process\_overall.py", line 49, in run
File "whisper\transcribe.py", line 295, in transcribe
File "whisper\transcribe.py", line 201, in decode_with_fallback
File "torch\utils\_contextlib.py", line 116, in decorate_context

return func(*args, **kwargs)

File "whisper\decoding.py", line 824, in decode
File "torch\utils\_contextlib.py", line 116, in decorate_context

return func(*args, **kwargs)

File "whisper\decoding.py", line 737, in run
File "whisper\decoding.py", line 703, in _main_loop
File "whisper\decoding.py", line 283, in update
File "torch\distributions\categorical.py", line 73, in init

super().__init__(batch_shape, validate_args=validate_args)

File "torch\distributions\distribution.py", line 72, in init

raise ValueError(

ValueError: Expected parameter logits (Tensor of shape (1, 51866)) of distribution Categorical(logits: torch.Size([1, 51866])) to satisfy the constraint IndependentConstraint(Real(), 1), but found invalid values:
tensor([[nan, nan, nan, ..., nan, nan, nan]], device='cuda:0')

TaskCfg(cache_folder='C:/Users/Administrator/Documents/11/tmp/4696/acac0fcd6a', target_dir='/192.168.50.88/hh日本🇯🇵-2/1111/1995-嶋野遥香/_video_out/1995-嶋野遥香-mp4', remove_noise=False, is_separate=False, detect_language='ja', subtitle_language=None, source_language='日语', target_language='简体中文', source_language_code='ja', target_language_code='zh-cn', source_sub='/192.168.50.88/hh日本🇯🇵-2/1111/1995-嶋野遥香/_video_out/1995-嶋野遥香-mp4/ja.srt', target_sub='/192.168.50.88/hh日本🇯🇵-2/1111/1995-嶋野遥香/_video_out/1995-嶋野遥香-mp4/zh-cn.srt', source_wav='C:/Users/Administrator/Documents/11/tmp/4696/acac0fcd6a/ja.wav', source_wav_output='/192.168.50.88/hh日本🇯🇵-2/1111/1995-嶋野遥香/_video_out/1995-嶋野遥香-mp4/ja.m4a', target_wav='C:/Users/Administrator/Documents/11/tmp/4696/acac0fcd6a/target.wav', target_wav_output='/192.168.50.88/hh日本🇯🇵-2/1111/1995-嶋野遥香/_video_out/1995-嶋野遥香-mp4/zh-cn.m4a', subtitles='', novoice_mp4='C:/Users/Administrator/Documents/11/tmp/4696/acac0fcd6a/novoice.mp4', noextname='1995-嶋野遥香', shibie_audio=None, targetdir_mp4='/192.168.50.88/hh日本🇯🇵-2/1111/1995-嶋野遥香/_video_out/1995-嶋野遥香-mp4/1995-嶋野遥香.mp4', instrument=None, vocal=None, back_audio='', background_music=None, app_mode='tiqu', subtitle_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='No', copysrt_rawvideo=True, clear_cache=True, translate_type=14, tts_type=0, recogn_type=1, model_name='large-v3-turbo', split_type=0, voice_autorate=False, video_autorate=False, cuda=True, name='//192.168.50.88/hh日本🇯🇵-2/1111/1995-嶋野遥香/1995-嶋野遥香.mp4', basename='1995-嶋野遥香.mp4', ext='mp4', dirname='//192.168.50.88/hh日本🇯🇵-2/1111/1995-嶋野遥香', shound_del_name=None, uuid='acac0fcd6a', remove_silent_mid=False, align_sub_audio=True, enable_diariz=False, nums_diariz=0, rephrase=2, only_out_mp4=False)


=
system:Windows-10-10.0.19045-SP0
version:v3.90
frozen:True
language:zh
root_dir:C:/Users/Administrator/Documents/11

1 Replies

您遇到的错误是 openai-whisper 本地识别时,模型输出的 logits 张量出现了 NaN(非数字)值,这通常与模型文件损坏、CUDA计算不稳定或显存问题有关。

核心解决方案:更换语音识别模型或修复模型文件。

请按以下步骤操作:

  1. 更换识别模型(推荐)

    • 在主界面第2行“语音识别”处,将模型从 openai-whisper(本地) 切换为 faster-whisper(本地)
    • faster-whisper 是更稳定、更节省显存的替代方案,功能相同。
  2. 如果必须使用 openai-whisper,请尝试修复

    • 重新下载模型:模型文件可能已损坏。请删除缓存目录中的模型文件。默认路径通常在 C:\Users\[用户名]\.cache\whisper\ 下,删除 large-v3-turbo 文件夹(或您选择的模型文件夹),软件会在下次运行时自动重新下载。
    • 调整计算精度:在菜单栏选择 工具/选项 -> 高级选项,找到“Faster/OpenAI/Whisper 语音识别微调”区域,尝试将 CUDA数据类型float16 改为 float32(如果当前是 float16),或反之。这可以解决某些CUDA下的数值稳定性问题。
    • 降低识别参数:在同一区域,将 beam_sizebest_of 的值都设为 1,以降低计算复杂度。
  3. 检查视频/音频文件

    • 确保您处理的视频文件本身音频轨道正常,可以尝试用其他播放器播放确认。
    • 路径 //192.168.50.88/... 是网络路径,请确保网络连接稳定,文件可正常访问。

首选方案是直接切换到 faster-whisper(本地) 模型,这是最快速有效的解决方法。

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.

Donate: https://ko-fi.com/jianchang512

Similar issues already exist

Trending Questions