https://github.com/rusty1s/pytorch_sparse
1、
You can now install pytorch-sparse via Anaconda for all major OS/PyTorch/CUDA combinations Given that you have pytorch >= 1.8.0 installed, simply run
conda install pytorch-sparse -c pyg
2、
PyTorch 1.10.0
To install the binaries for PyTorch 1.10.0, simply run
pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-1.10.0+${CUDA}.html
where ${CUDA} should be replaced by either cpu, cu102, or cu113 depending on your PyTorch installation.
我用的第二种方法,我的cuda是11.5,命令如下:
pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-1.10.0+cu113.html
查看pytorch版本:
import torch
print(torch.__version__) #注意是双下划线