#1282 tensor([[nan, nan, nan, ..., nan, nan, nan]], device='cuda:0')

2a02:ce0* Posted at: 12 hours ago 👁13

Error during speech recognition:[openai-whisper (local)] Runtime error: 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 105, in run
File "videotrans\task\trans_create.py", line 368, in recogn
File "videotrans\recognition\__init__.py", line 197, in run
File "videotrans\recognition\_base.py", line 78, in run
File "videotrans\recognition\_openai.py", line 132, in _exec
RuntimeError: 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')


=
system:Windows-10-10.0.26200-SP0
version:v3.83
frozen:True
language:en
root_dir:F:/Ahmed/Programs/win-videotrans-v3.83

1 Replies

This error indicates that the OpenAI Whisper model is producing NaN (Not a Number) values during inference on your GPU (CUDA). This is typically caused by a CUDA compatibility issue or corrupted model data.

Here are the recommended solutions:

  1. Disable CUDA Acceleration (Quick Fix):

    • In the main interface, uncheck the "CUDA acceleration" option.
    • This will force the model to run on your CPU, which is slower but more stable. Try processing your file again.
  2. Update GPU Drivers and CUDA (Permanent Fix):

    • Update your NVIDIA graphics drivers to the latest version.
    • Ensure you have CUDA 12.x installed. The pre-packaged Windows version uses torch2.7.1+cu128, which is designed for CUDA 12.
  3. Clear the Model Cache:

    • The Whisper model files might be corrupted. Delete the cache folder located at C:\Users\[YourUsername]\.cache\whisper (or the equivalent on your system). The software will re-download the model the next time you run it.
  4. Switch Recognition Model:

    • As a temporary workaround, try using a different speech recognition model, such as "faster-whisper (local)".

Start with step 1 (disabling CUDA) to confirm the issue is related to GPU processing. If the problem persists, please provide the latest log file from the F:/Ahmed/Programs/win-videotrans-v3.83/logs/ directory.

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