#5204 TaskCfgSTT(uuid='2d65212b45', name='E:/DownLoad/DCL/ASHLEY MASON – MOMMY PANTY ANAL.mp4', dirname='E:/DownLoad/DCL', noe

106.61* Posted at: 4 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='2d65212b45', name='E:/DownLoad/DCL/ASHLEY MASON – MOMMY PANTY ANAL.mp4', dirname='E:/DownLoad/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/1148/2d65212b45', 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='zh-cn', recogn_type=1, model_name='large-v3-turbo', shibie_audio='D:/win-pyvideotrans-v4.01-0602/tmp/1148/2d65212b45/ASHLEY MASON – MOMMY PANTY ANAL-1781522422.7093844.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

Voice recognition error with openai-whisper(本地) — the GPU calculated invalid values (NaN) during model inference, usually due to insufficient VRAM or numerical instability.

Solutions (try in order):

  1. Switch to a smaller model: change from large-v3-turbo to medium or small in the ASR dropdown.
  2. Lower compute precision: go to Menu → Tools → Advanced Options → Speech Recognition, set Compute type to float16 (or int8).
  3. Reduce beam search depth: set beam_size and best_of both to 1 in the same Advanced Options panel.
  4. Disable CUDA: uncheck CUDA acceleration on the main interface and run on CPU (slower but avoids NaN).
  5. Update GPU driver & CUDA: ensure you have CUDA 12.8+ and cuDNN 9.11+ installed correctly.

After each change, restart the task (check Clean generated to avoid using old cache).

If the problem persists, please provide the latest log file from logs/ folder for further diagnosis.

Post Your Reply