Pytorch Torch_Sparse Installation Without Cuda

I am new in PyTorch and I have faced one issue, namely I cannot get my torch_sparse module properly installed. In general, I wanted to use module torch_geometric - this I have installed. However, when during the execution of the program I keep receiving the error ModuleNotFoundError: No module named ‘torch_sparse’ .

I try to intall it, but when I use the command pip install torch-sparse in anaconda, I get an error:

UserWarning: CUDA initialization:Found no NVIDIA driver on your system.

My system does not have a CUDA. So how could I install torch_sparse module without it?

Thank you in advance!

Kind regards

Rostyslav

2 Answers

As outlined in in pytorch_geometric installation instructions you have to install dependencies first and torch_geometric after that.

For PyTorch 1.7.0 and CPU:

pip install --no-index torch-scatter -f 
pip install --no-index torch-sparse -f 
pip install --no-index torch-cluster -f 
pip install --no-index torch-spline-conv -f 
pip install torch-geometric

Please notice torch-1.7.0+cpu at the very end of each page

7

I have found the use of conda instead of pip very useful. Running the following three commands turned out to be smooth and without errors:

  1. conda install -c pyg pytorch-sparse
  2. conda install -c pyg pytorch-scatter
  3. conda install -c pyg pyg

As far as I understood from the torch-geometric docs,we should be fine with these commands on CUDA/CPU.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest