Vaibhavs10 / insanely-fast-whisper

Apache License 2.0
7.49k stars 527 forks source link

Torch not compiled with CUDA enabled #220

Closed welldawell closed 2 months ago

welldawell commented 4 months ago

I followed the instructions on in the readme on https://github.com/Vaibhavs10/insanely-fast-whisper to install insanely-fast-whisper using a command line in Windows 11 and pipx install insanely-fast-whisper --force --pip-args="--ignore-requires-python" (I'm using Python 3.11.4).

I also used the fix for the error message of the title after it appeared the first time: python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

But when re-executing the command insanely-fast-whisper --file-name untitled.wav

the following output is still shown: `Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.


198 _run_module_as_main 88 _run_code __main__.py 7 sys.exit(main()) cli.py 94 main pipe = pipeline( __init__.py 1108 pipeline return pipeline_class(model=model, framework=framework, task=task, **kwargs) automatic_speech_recognition.py 220 __init__ super().__init__(model, tokenizer, feature_extractor, device=device, torch_dtype=torch_dtype, **kwargs) base.py 882 __init__ self.model.to(self.device) modeling_utils.py 2692 to return super().to(*args, **kwargs) module.py 1173 to return self._apply(convert) module.py 779 _apply module._apply(fn) module.py 779 _apply module._apply(fn) module.py 779 _apply module._apply(fn) module.py 804 _apply param_applied = fn(param) module.py 1159 convert return t.to( __init__.py 284 _lazy_init raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled ` I have a Nvidia GeForce RTX 4060 with CUDA compiler driver 12.4 installed. Is there anything which I can do or check? Thanks for any help.
Pitzilla commented 4 months ago

You will need to download the respective CUDA software, i have found 11.8 works and then use the PyTorch 11.8 as well installing after the initial install. Keep with Python 3.11.x. This worked for me today.

welldawell commented 3 months ago

Thanks, but still the same error on my side. This is what I did:

  1. I uninstalled CUDA 12.1 and installed the CUDA Toolkit 11.8 by downloading it from https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Windows&target_arch=x86_64&target_version=11&target_type=exe_local for my installed Windows 11 OS.

  2. I opened the cmd and uninstalled insanely-fast-whisper by using pipx uninstall insanely-fast-whisper

  3. I installed it again using pipx install insanely-fast-whisper --force --pip-args="--ignore-requires-python"

  4. I uninstalled torch by using pip3 uninstall torch torchvision torchaudio

  5. I installed torch again by using pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

  6. As I got the same error message when I executed insanely-fast-whisper --file-name untitled.wav I tried again to uninstall torch and install it again using a modified fix for the error from the GitHub page: python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

Still I get the error message "AssertionError: Torch not compiled with CUDA enabled".

What am I doing wrong? Thanks again.

albertyu647 commented 3 months ago

Try uninstalling with pipx pipx uninstall insanely-fast-whisper then installing with pip instead pip install insanely-fast-whisper --ignore-requires-python that worked for me

welldawell commented 2 months ago

This finally works also for me, thanks!