#5213 TaskCfgSTT(uuid='5be3185585', name='E:/DCL/ASHLEY MASON – MOMMY PANTY ANAL.mp4', dirname='E:/DCL', noextname='ASHLEY MAS

106.61* Posted at: 2 hours ago

语音识别阶段出错[openai-whisper(本地)] 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\process\stt_fun.py", line 102, in openai_whisper
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 35, in run

File "videotrans\task\job.py", line 100, in process_task

File "videotrans\task\speech2text.py", line 126, in recogn

File "videotrans\recognition\__init__.py", line 190, in run

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

File "videotrans\recognition\_whisper.py", line 34, in _exec

File "videotrans\recognition\_whisper.py", line 77, in _openai

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

videotrans.configure.excepts.VideoTransError: 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\process\stt_fun.py", line 102, in openai_whisper
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')
TaskCfgSTT(uuid='5be3185585', name='E:/DCL/ASHLEY MASON – MOMMY PANTY ANAL.mp4', dirname='E:/DCL', noextname='ASHLEY MASON – MOMMY PANTY ANAL', basename='ASHLEY MASON – MOMMY PANTY ANAL.mp4', ext='mp4', target_dir='D:/win-pyvideotrans-v4.01-0602/output/recogn', cache_folder='D:/win-pyvideotrans-v4.01-0602/tmp/11692/5be3185585', 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:/win-pyvideotrans-v4.01-0602/output/recogn/ASHLEY MASON – MOMMY PANTY ANAL.srt', target_wav=None, target_wav_output=None, detect_language='auto', recogn_type=1, model_name='large-v3-turbo', shibie_audio='D:/win-pyvideotrans-v4.01-0602/tmp/11692/5be3185585/ASHLEY MASON – MOMMY PANTY ANAL-1781529244.149471.wav', remove_noise=False, enable_diariz=False, nums_diariz=0, rephrase=0, fix_punc=False)


=
system:Windows-10-10.0.26100-SP0
version:v4.01
frozen:True
language:zh
root_dir:D:/win-pyvideotrans-v4.01-0602

1 Replies

GPU计算出现NaN张量,是CUDA环境不兼容或显存不足导致模型推理崩溃的典型表现。请按以下步骤排查:

  1. 验证CUDA与cuDNN版本:软件要求CUDA 12.8+、cuDNN 9.11+。打开CMD运行 nvcc -Vnvidia-smi 确认版本。若版本过低,需重新安装对应版本。
  2. 降低模型计算精度:进入 菜单 -> 工具 -> 高级选项 -> 语音识别参数,将 计算数据类型 从默认切换为 float16int8,并重启任务。
  3. 关闭CUDA加速测试:取消勾选主界面中的 CUDA加速,改用CPU处理。若CPU下正常工作,则确认是GPU环境问题。
  4. 降低模型尺寸:将 openai-whisper(本地) 的模型从 large-v3-turbo 临时换为 smallbase,如果不再报错则说明原模型占用显存过大。

若以上无效,请提供 logs/ 文件夹中最新日志的最后30行内容。

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