Can not install CUDA enabled PyTorch


I was trying to run a GPU based code. I followed the PyTorch official website to install PyTorch using ” conda install pytorch torchvision pytorch-cuda=11.6 -c pytorch -c nvidia”

However, when I try to run the code, this error occur:

“AssertionError: Torch not compiled with CUDA enabled”

Also, when I use “conda list” to see all the packages, I find out the pytorch is based on CPU.

“pytorch 1.10.2 cpu_py38h6f0ae12_0
pytorch-cuda 11.6 h867d48c_0 pytorch”

I wonder if there is any way to install cuda enabled pytorch.

Thanks for your time in advance!

Not only is a CPU-only binary installed but also an older one (1.10.2 while the current stable release is 1.13.0 as shown in your screenshot).
Uninstall all older PyTorch binaries and builds, and reinstall the new desired one. Creating a new and clean virtual conda environment might also help.