pyannote-audio icon indicating copy to clipboard operation
pyannote-audio copied to clipboard

pyannote uninstalling torch cuda and install torch cpu

Open versus666jzx opened this issue 11 months ago • 8 comments

Tested versions

  • Reproducible in Version 3.1.1

System information

win11, pyannote.audio 3.1.1

Issue description

If I install pyannote.audio in an env in which torch with cuda is already installed, then during installation the torch with cuda is removed and torch cpu is installed. Even though the torch versions satisfy requirements.txt.

image

Minimal reproduction example (MRE)

pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu118 pip install pyannote.audio

versus666jzx avatar Mar 18 '24 09:03 versus666jzx

Same problem omg

Valeronich avatar Mar 18 '24 10:03 Valeronich

Struggled with that too...

gdk00 avatar Mar 18 '24 10:03 gdk00

same issue

beton18 avatar Mar 18 '24 10:03 beton18

I'd suggest using the same --index-url when installing pyannote.audio.

pip install pyannote.audio --index-url https://download.pytorch.org/whl/cu118

hbredin avatar Mar 18 '24 10:03 hbredin

I'd suggest using the same --index-url when installing pyannote.audio.

pip install pyannote.audio --index-url https://download.pytorch.org/whl/cu118

Expectedly doesn't work.

image

versus666jzx avatar Mar 18 '24 10:03 versus666jzx

But if use this

pip install pyannote.audio --extra-index-url https://download.pytorch.org/whl/cu118

then torch and torchaudio packages with cuda support will be installed

image

It would be cool if this was somehow reflected in the installation documentation or if the requirements.txt or setup files were corrected.

versus666jzx avatar Mar 18 '24 10:03 versus666jzx

It would be cool if you could open a PR fixing this now that you have found a solution.

hbredin avatar Mar 18 '24 11:03 hbredin

But if use this

pip install pyannote.audio --extra-index-url https://download.pytorch.org/whl/cu118

then torch and torchaudio packages with cuda support will be installed

image

It would be cool if this was somehow reflected in the installation documentation or if the requirements.txt or setup files were corrected.

Hey friend, am trying to get this to work myself, but after running this, it yells at me about torchvision. Error importing pyannote.audio, torch, torchvision, or torchaudio: No module named 'torchvision'

I use this script that our lovely AI overlord generated for me to check my environment:

import torch
import torchaudio
import torchvision
import speechbrain

print("PyTorch Version:", torch.__version__)
print("CUDA Available:", torch.cuda.is_available())
print("CUDA Version:", torch.version.cuda)
print("torchaudio version:", torchaudio.__version__)
print("torchvision version:", torchvision.__version__)
print("speechbrain version:", speechbrain.__version__)

# Check if CUDA is available
print("CUDA available:", torch.cuda.is_available())
if torch.cuda.is_available():
    print("CUDA device name:", torch.cuda.get_device_name(0))

ThatJeffGuy avatar Jun 10 '24 23:06 ThatJeffGuy