pythonmodulepippytorch

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


Solution

  • 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 https://pytorch-geometric.com/whl/torch-1.7.0+cpu.html
    pip install --no-index torch-sparse -f https://pytorch-geometric.com/whl/torch-1.7.0+cpu.html
    pip install --no-index torch-cluster -f https://pytorch-geometric.com/whl/torch-1.7.0+cpu.html
    pip install --no-index torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.7.0+cpu.html
    pip install torch-geometric
    

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