How to use Pytorch 1.5 without installing CUDA

I was wondering how we could use PyTorch with just cpus. There were previous builds which separated gpu/cpu, but using 1.5 allows for more complex indexing, so I wanted to find a way to use the most updated stable version of PyTorch without installing cuda (won’t be able to use GPUs based on hardware constraints).

Thanks!

For the CPU only version, you would have to select the CUDA None option on the website.

This command would install 1.5 without CUDA:

conda install pytorch torchvision cpuonly -c pytorch

To clarify, I’m trying to use libtorch. Can I edit the libtorch cmake file (i.e. TorchConfig.cmake) in order to not care about CUDA installation?

The CPU libtorch package shouldn’t care about CUDA, right?
What kind of error are you getting and how are you building your project?

Oh my… I should go to sleep. I didn’t even see the None option for CUDA when downloading libtorch. I’m so sorry!!!

Haha, no worries! Let me know, if it still yields errors. :slight_smile: