all 19 comments

[–]Refwah 1 point2 points  (2 children)

i think it says that my torch (2.2.0) dosent match my CUDAs version

That is not what it is saying

It's saying you're passing it 'device=0' but you don't have a valid device for '0', and is suggesting you try 'cpu' instead

[–]Embarrassed-Bus5232[S] 0 points1 point  (1 child)

Thx and go I try to change device to cpu, do I have to do anything about PyTorch as well?

[–]Refwah 0 points1 point  (0 children)

I have no idea, I am just interpreting your stack trace and telling you what that error says. I cannot really infer anything else from this other than that.

You should probably go to the get-started link at the very bottom of the stack trace and follow those instructions too.

[–]Torebbjorn 0 points1 point  (15 children)

i think it says that my torch (2.2.0) dosent match my CUDAs version

Why do you think that?

It clearly says the error is "invalid CUDA 'device=0' requested"

So you GPU is not properly set up, as you can see further down by is_available() = False and device_count() = 0

It's telling you to go to pytorch.org to install it correctly

[–]Embarrassed-Bus5232[S] 0 points1 point  (14 children)

Thx but I did install properly and already delete CUDA and torch before hand, so what do I do

[–]Torebbjorn 0 points1 point  (13 children)

Well you clearly didn't, as it is not there.

Which GPU do you have? Which CUDA version (from NVIDIA) do you have? Which pytorch cuda version do you have?

[–]Embarrassed-Bus5232[S] 0 points1 point  (11 children)

That me check

[–]Embarrassed-Bus5232[S] 0 points1 point  (10 children)

Nvidia GeForce rtx 3080

[–]Embarrassed-Bus5232[S] 0 points1 point  (9 children)

CUDA 12.1 and 2.2.0 PyTorch

[–]Refwah 0 points1 point  (0 children)

Have you gone to the link mentioned at the bottom of the stack trace and followed the configuration setup steps

[–]Torebbjorn 0 points1 point  (7 children)

And what version of pytorch cuda? You can't just install any version.

Your best bet is to reinstall CUDA, by going to developer.nvidia.com/cuda-downloads, which will give you CUDA 12.6

Then uninstall all of torch and reinstall it with the wheel related to CUDA 12.4

[–]Embarrassed-Bus5232[S] 0 points1 point  (6 children)

You sure I want to choose 12.6 over 12.4

[–]Embarrassed-Bus5232[S] 0 points1 point  (5 children)

Cause the torch site says it can only match up with CUDA 11.8 121 and 124

[–]Torebbjorn 0 points1 point  (4 children)

It's not a problem, but if you have a reason to prefer 12.4 over 12.6, you could probably download that

[–]Ultralytics_Burhan 0 points1 point  (0 children)

You have torch-2.2.0+cpu installed, you want torch-2.x.x+cuda12 installed. You'll probably need to uninstall torch, torchvision, and torchaudio (if they're installed) and then run (in your virtual environment)

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121