pytorch-geometric安装

1.确定PyTorch版本

python -c "import torch; print(torch.__version__)"

以我的电脑为例:

我的troch环境是1.8.0+cpu,这个参数很重要,后面pytorch-geometric安装要用到

如果你的torch是GPU版本,那么找到cuda版本,比如:cu110

GPU版本的torch查看cuda版本:

python -c "import torch; print(torch.__version__)"

2. 下载pytorch-geometric依赖包

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 torch-geometric

${TORCH}   ${CUDA} 替换成第一步查看到的torch版本和cuda版本,比如,我的torch是 1.8.0+cpu ,那么我的安装命令就是

pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.8.0+cpu.html
pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.8.0+cpu.html
pip install torch-cluster -f https://pytorch-geometric.com/whl/torch--1.8.0+cpu.html
pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch--1.8.0+cpu.html
pip install torch-geometric

如果你的torch是gpu版本的,那么同理,将上面的cpu换成‘cuxxx’(举个例子,实际换成什么要看你自己的cuda版本,比如cu110)

到这儿就完成啦,可以开始做简单的图神经网络任务了

 

参考:https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值