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

torchvision' object has no attribute '_cuda_version' #8819

Open
Flippchen opened this issue Dec 19, 2024 · 0 comments
Open

torchvision' object has no attribute '_cuda_version' #8819

Flippchen opened this issue Dec 19, 2024 · 0 comments

Comments

@Flippchen
Copy link

🐛 Describe the bug

I am using a MacBook 15.1.1 (24B91) running Python 3.10.

I installed torch and torchvision through pip with pip install -U torch torchvision and it gave the following output:

Installing collected packages: torch, torchvision
 Attempting uninstall: torch
   Found existing installation: torch 1.13.1
   Uninstalling torch-1.13.1:
     Successfully uninstalled torch-1.13.1
 Attempting uninstall: torchvision
   Found existing installation: torchvision 0.14.0
   Uninstalling torchvision-0.14.0:
     Successfully uninstalled torchvision-0.14.0
Successfully installed torch-2.5.1 torchvision-0.20.1

After that I go into a terminal in venv and run

import torch-> works as expected
import torchvision-> Gives the following error:

>>> import torchvision
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/Users/flippchen/project/venv/lib/python3.10/site-packages/torchvision/__init__.py", line 9, in <module>
   from .extension import _HAS_OPS  # usort:skip
 File "/Users/flippchen/project/venv/lib/python3.10/site-packages/torchvision/extension.py", line 92, in <module>
   _check_cuda_version()
 File "/Users/flippchen/project/venv/lib/python3.10/site-packages/torchvision/extension.py", line 65, in _check_cuda_version
   _version = torch.ops.torchvision._cuda_version()
 File "/Users/flippchen/project/venv/lib/python3.10/site-packages/torch/_ops.py", line 1225, in __getattr__
   raise AttributeError(
AttributeError: '_OpNamespace' 'torchvision' object has no attribute '_cuda_version'

I have tried several torch and torchvision combinations from the website, but none of them work.

Versions

PyTorch version: 2.5.1
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 15.1.1 (arm64)
GCC version: Could not collect
Clang version: 16.0.0 (clang-1600.0.26.4)
CMake version: version 3.30.4
Libc version: N/A

Python version: 3.10.10 (v3.10.10:aad5f6a891, Feb 7 2023, 08:47:40) [Clang 13.0.0 (clang-1300.0.29.30)] (64-bit runtime)
Python platform: macOS-15.1.1-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Apple M3 Pro

Versions of relevant libraries:
[pip3] numpy==1.24.3
[pip3] onnx==1.17.0
[pip3] onnx-graphsurgeon==0.5.2
[pip3] onnx2tf==1.22.3
[pip3] onnxruntime==1.20.1
[pip3] onnxslim==0.1.44
[pip3] optree==0.13.1
[pip3] sng4onnx==1.0.4
[pip3] torch==2.5.1
[pip3] torchvision==0.20.1
[conda] Could not collect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant