Git Product home page Git Product logo

Comments (7)

davabase avatar davabase commented on August 12, 2024 2

You must have ffmpeg installed on your machine.

You can install it with Chocolatey like so:

# using Chocolatey (https://chocolatey.org/)
choco install ffmpeg

or with Scoop:

# using Scoop (https://scoop.sh/)
scoop install ffmpeg

or from the ffmpeg website: https://ffmpeg.org/

from whisper_real_time.

ibrahim91015 avatar ibrahim91015 commented on August 12, 2024

Works! Thanks!
Using quite a bit of CPU, anyway to have it use the gpu instead?

from whisper_real_time.

davabase avatar davabase commented on August 12, 2024

To make sure you are using the CUDAversion of pytorch you can do a pip uninstall torch and then install the CUDA version of pytorch with:

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117

from the pytorch website.
If you installed via the requirements.txt this should already be true.
Make sure torch.cuda.is_available() is True in your environment.
Whisper should detect your GPU and use it automatically in that case, if it's not you can changing line 69 to:

audio_model = whisper.load_model(model, device="cuda")

to force it to use the GPU.

from whisper_real_time.

ibrahim91015 avatar ibrahim91015 commented on August 12, 2024

did that, now im gettin this error:

Traceback (most recent call last):
  File "C:\Users\ibrah\Desktop\whisper_real_time-master\transcribe_demo.py", line 152, in <module>
    main()
  File "C:\Users\ibrah\Desktop\whisper_real_time-master\transcribe_demo.py", line 69, in main
    audio_model = whisper.load_model(model, device="cuda")
  File "C:\Users\ibrah\AppData\Local\Programs\Python\Python38\lib\site-packages\whisper\__init__.py", line 144, in load_model
    checkpoint = torch.load(fp, map_location=device)
  File "C:\Users\ibrah\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\serialization.py", line 809, in load
    return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
  File "C:\Users\ibrah\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\serialization.py", line 1172, in _load
    result = unpickler.load()
  File "C:\Users\ibrah\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\serialization.py", line 1142, in persistent_load
    typed_storage = load_tensor(dtype, nbytes, key, _maybe_decode_ascii(location))
  File "C:\Users\ibrah\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\serialization.py", line 1116, in load_tensor
    wrap_storage=restore_location(storage, location),
  File "C:\Users\ibrah\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\serialization.py", line 1083, in restore_location
    return default_restore_location(storage, map_location)
  File "C:\Users\ibrah\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\serialization.py", line 217, in default_restore_location
    result = fn(storage, location)
  File "C:\Users\ibrah\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\serialization.py", line 182, in _cuda_deserialize
    device = validate_cuda_device(location)
  File "C:\Users\ibrah\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\serialization.py", line 166, in validate_cuda_device
    raise RuntimeError('Attempting to deserialize object on a CUDA '
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.

from whisper_real_time.

davabase avatar davabase commented on August 12, 2024
torch.cuda.is_available() is False

Unfortunately it looks like you do not have a CUDA compatible GPU.

from whisper_real_time.

ibrahim91015 avatar ibrahim91015 commented on August 12, 2024

that's weird
image
image

from whisper_real_time.

joacripto avatar joacripto commented on August 12, 2024

Hi!, I have the same problem than @ibrahim91015. The script runs well on CPU but I force the use of the GPU, I get the same torch.cuda.is_available() is False error, but:
`❯ nvidia-smi
Sat Aug 26 18:20:07 2023
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 532.09 Driver Version: 532.09 CUDA Version: 12.1 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce RTX 4080 L... WDDM | 00000000:01:00.0 On | N/A |
| N/A 46C P8 8W / N/A| 382MiB / 12282MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
+---------------------------------------------------------------------------------------+`
So, any ideas?

Thak you so much

from whisper_real_time.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.