Vaibhavs10 / insanely-fast-whisper

Apache License 2.0
7.79k stars 547 forks source link

Doesn't detect CUDA #183

Open dgoryeo opened 9 months ago

dgoryeo commented 9 months ago

I continue to receive error Torch not compiled with CUDA enabled, but my pytorch and cudatoolkit installations are correct: cuda toolkit 11.8, and pytorch 2.1.


insanely_fast_whisper\cli.py", line 94, in main
    pipe = pipeline(
  File "C:\Users\MK\.local\pipx\venvs\insanely-fast-whisper\lib\site-packages\transformers\pipelines\__init__.py", line 1070, in pipeline
    return pipeline_class(model=model, framework=framework, task=task, **kwargs)
  File "C:\Users\MK\.local\pipx\venvs\insanely-fast-whisper\lib\site-packages\transformers\pipelines\automatic_speech_recognition.py", line 227, in __init__
    super().__init__(model, tokenizer, feature_extractor, device=device, torch_dtype=torch_dtype, **kwargs)
  File "C:\Users\MK\.local\pipx\venvs\insanely-fast-whisper\lib\site-packages\transformers\pipelines\base.py", line 840, in __init__
    self.model.to(self.device)
  File "C:\Users\MK\.local\pipx\venvs\insanely-fast-whisper\lib\site-packages\transformers\modeling_utils.py", line 2595, in to
    return super().to(*args, **kwargs)
  File "C:\Users\MK\.local\pipx\venvs\insanely-fast-whisper\lib\site-packages\torch\nn\modules\module.py", line 1152, in to
    return self._apply(convert)
  File "C:\Users\MK\.local\pipx\venvs\insanely-fast-whisper\lib\site-packages\torch\nn\modules\module.py", line 802, in _apply
    module._apply(fn)
  File "C:\Users\MK\.local\pipx\venvs\insanely-fast-whisper\lib\site-packages\torch\nn\modules\module.py", line 802, in _apply
    module._apply(fn)
  File "C:\Users\MK\.local\pipx\venvs\insanely-fast-whisper\lib\site-packages\torch\nn\modules\module.py", line 802, in _apply
    module._apply(fn)
  File "C:\Users\MK\.local\pipx\venvs\insanely-fast-whisper\lib\site-packages\torch\nn\modules\module.py", line 825, in _apply
    param_applied = fn(param)
  File "C:\Users\MK\.local\pipx\venvs\insanely-fast-whisper\lib\site-packages\torch\nn\modules\module.py", line 1150, in convert
    return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
  File "C:\Users\MK\.local\pipx\venvs\insanely-fast-whisper\lib\site-packages\torch\cuda\__init__.py", line 293, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
arces commented 9 months ago

I got that same error

gokeji commented 9 months ago

UPDATE: Using insanely-fast-whisper without the CLI (and running python script directly) seems to get around this issue.

The README includes a suggestion for this error. However even after reinstalling pytorch in my virtual env, I still get the same error.

Instructions on README:

How to solve an AssertionError: Torch not compiled with CUDA enabled error on Windows?

The root cause of this problem is still unknown, however, you can resolve this by manually installing torch in the virtualenv like `python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121`. Thanks to @pto2k for all tdebugging this.
sadimoodi commented 7 months ago

UPDATE: Using insanely-fast-whisper without the CLI (and running python script directly) seems to get around this issue.

The README includes a suggestion for this error. However even after reinstalling pytorch in my virtual env, I still get the same error.

Instructions on README:

How to solve an AssertionError: Torch not compiled with CUDA enabled error on Windows?

The root cause of this problem is still unknown, however, you can resolve this by manually installing torch in the virtualenv like `python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121`. Thanks to @pto2k for all tdebugging this.

i got the same problem even after following the instructions mentioned above in the readme file, installing via pip fixed it, pipx installation wont work