diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

RuntimeError: Detected that PyTorch and torchvision were compiled with different CUDA versions.

Open ganeshrk1342 opened this issue 1 year ago β€’ 8 comments

Describe the bug

RuntimeError: Detected that PyTorch and torchvision were compiled with different CUDA versions. PyTorch has CUDA Version=11.7 and torchvision has CUDA Version=11.8. Please reinstall the torchvision that matches your PyTorch install.

Reproduction

/usr/local/lib/python3.10/dist-packages/torchvision/extension.py:80 in β”‚ β”‚ _check_cuda_version β”‚ β”‚ β”‚ β”‚ 77 β”‚ β”‚ t_major = int(t_version[0]) β”‚ β”‚ 78 β”‚ β”‚ t_minor = int(t_version[1]) β”‚ β”‚ 79 β”‚ β”‚ if t_major != tv_major or t_minor != tv_minor: β”‚ β”‚ ❱ 80 β”‚ β”‚ β”‚ raise RuntimeError( β”‚ β”‚ 81 β”‚ β”‚ β”‚ β”‚ "Detected that PyTorch and torchvision were compiled w β”‚ β”‚ 82 β”‚ β”‚ β”‚ β”‚ f"PyTorch has CUDA Version={t_major}.{t_minor} and tor β”‚ β”‚ 83 β”‚ β”‚ β”‚ β”‚ f"CUDA Version={tv_major}.{tv_minor}. "

Logs

No response

System Info

Python 3.11.2

MacBookPro M2, mac OS ventura version 13.2.1

ganeshrk1342 avatar May 18 '23 18:05 ganeshrk1342

All I did was install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1 and it worked fine.

Windows

Nirvs1 avatar May 18 '23 22:05 Nirvs1

Also have the same problem.

superpingers avatar May 19 '23 10:05 superpingers

Same issue on Colab. Confirm the fix with running the following in the beginning.

%pip install torch==2.0.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

andrewssdd avatar May 19 '23 11:05 andrewssdd

Same issue on Colab. Confirm the fix with running the following in the beginning.

%pip install torch==2.0.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

Added torchdata and torchtext and it worked fine.

%pip install torch==2.0.0 torchvision torchaudio torchdata torchtext --index-url https://download.pytorch.org/whl/cu118

souzanato avatar May 19 '23 13:05 souzanato

This thead saved my day. Thanks guys!

yandod avatar May 21 '23 08:05 yandod

@freddieb12345 I had the same issue. This resolved it:

%pip install torch==2.0.0+cu118 torchvision torchaudio torchdata torchtext --index-url https://download.pytorch.org/whl/cu118
Screen Shot 2023-05-23 at 17 26 53

a-ghorbani avatar May 23 '23 15:05 a-ghorbani

can I get the colab notebook link please

VKY231 avatar May 24 '23 10:05 VKY231

Бтандартная вСрсия Π³ΡƒΠ³Π» ΠΊΠΎΠ»Π°Π± снова Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Π»Π°.

kostyanchik94 avatar May 24 '23 10:05 kostyanchik94