查看torch版本
import torch
print(torch.version.cuda)"
print(torch.__version__)
查找对应的pyg依赖包
前往这个链接:https://data.pyg.org/whl/
比如说我的cuda_version是11.3,torch版本是1.12.0,那么找到torch-1.12.0+cu113这个版本,点进去,里面就是pyg所需要的所有的依赖包,复制这个网站的链接。
安装方法
-f后面跟的是你刚刚复制的链接。
pip install --no-index torch-scatter -f https://data.pyg.org/whl/torch-1.12.0%2Bcu113.html
pip install --no-index torch-sparse -f https://data.pyg.org/whl/torch-1.12.0%2Bcu113.html
pip install --no-index torch-cluster -f https://data.pyg.org/whl/torch-1.12.0%2Bcu113.html
pip install --no-index torch-spline-conv -f https://data.pyg.org/whl/torch-1.12.0%2Bcu113.html
最后直接:
pip install torch-geometric
检查是否安装成功
import torch_geometric