综合

网络差就第一种离线安装,但是我只收录了这2个版本;网络好就第二个方案在线安装,更全面
一定要注意版本对应
版本对应目录表格,找到每个torch版本,点进去就可以找到对应的

一.离线安装

注意:安装顺序按我的序号来安装
版本一

  1. python 3.6.5 (若3.7.x,下面一一对应版本即可)
  2. torch: 1.7.1_cu110
  3. torch_cluster-1.5.9-cp36-cp36m-linux_x86_64.whl
  4. torch_scatter-2.0.7-cp36-cp36m-linux_x86_64.whl
  5. torch_sparse-0.6.9-cp36-cp36m-linux_x86_64.whl

再安装torch_geometric

pip install -U -i https://pypi.tuna.tsinghua.edu.cn/simple torch_geometric

版本二

  1. python 3.6.5(若3.7.x,下面一一对应版本即可)
  2. torch: 1.4.0_cu100
  3. torch_cluster-1.5.3+cu100-cp36-cp36m-linux_x86_64
  4. torch_scatter-2.0.3+cu100-cp36-cp36m-linux_x86_64
  5. torch_sparse-0.6.0+cu100-cp36-cp36m-linux_x86_64

再安装torch_geometric

pip install -U -i https://pypi.tuna.tsinghua.edu.cn/simple torch_geometric
.附录

pytorch离线版本包
torch_sparse离线版本包
torch-scatter离线安装包
torch-geometrics离线安装包
torch-geometrics离线包tar.gz
以及
torch_gpucuda安装流程

二. 在线安装

'1. 你需要知道你的torch版本,比如我的是如下:'
torch             1.11.0+cu113
# 如果不知道,查看torch版本
python -c "import torch; print(torch.__version__)"
python -c "import torch; print(torch.version.cuda)"
# 注意cuda记得和torch版本需求对应,cu113就是这个torch版本需要的cuda版本

'2. 然后'
pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html
pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html
pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html
pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html
pip install -U -i https://pypi.tuna.tsinghua.edu.cn/simple torch_geometric

'3. 举例,我的版本已经知道torch=1.11.0,cuda=113'
pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.11.0+cu113.html
pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.11.0+cu113.html
pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-1.11.0+cu113.html
pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.11.0+cu113.html
pip install -U -i https://pypi.tuna.tsinghua.edu.cn/simple torch_geometric

安装指定版本cuda教程

参考

https://zhuanlan.zhihu.com/p/381204915
https://blog.csdn.net/weixin_39505820/article/details/123007419

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐