pytorch正确的安装torch_geometric,无bug、多种类版本

综合

网络差就第一种离线安装,但是我只收录了这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

  • 28
    点赞
  • 54
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值