Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ganeshrk1342 opened this issue May 18, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@ganeshrk1342
Copy link

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 ganeshrk1342 added the bug Something isn't working label May 18, 2023
@Nirvs1
Copy link

Nirvs1 commented May 18, 2023

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

Windows

@superpingers
Copy link

Also have the same problem.

@andrewssdd
Copy link

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

@souzanato
Copy link

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

@yandod
Copy link

yandod commented May 21, 2023

This thead saved my day. Thanks guys!

@a-ghorbani
Copy link

@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

@VKY231
Copy link

VKY231 commented May 24, 2023

can I get the colab notebook link please

@kostyanchik94
Copy link

Стандартная версия гугл колаб снова заработала.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants