torch-geometric和torch-geometric-temporal库安装,版本对应

最近用到这两个库,安装过程遇到不少问题,记录一下安装过程。

首先,成功安装版本例子:python3.7 + CUDA11.3 + pytorch1.10.1-GPU版 + torch-geometric2.0.0(划重点) + 对应版本的依赖包(详见此网址)+torch-geometric-temporal 0.54.0

1.首先安装Anaconda,不再赘述。

2.创建并激活虚拟环境

conda create -n torch-geo python=3.7
activate torch-geo

3.安装CUDA和cudnn,以及pytorch,参考cuda安装torch安装以及版本对应

4.在安装torch-geometric之前需先装其依赖包,进入

https://pytorch-geometric.com/whl

查看自己对应版本,我选择的是 torch-1.10.1+cu113,因为我是win10系统,所以选择:

https://data.pyg.org/whl/torch-1.10.0%2Bcu113/torch_cluster-1.6.0-cp37-cp37m-win_amd64.whl
https://data.pyg.org/whl/torch-1.10.0%2Bcu113/torch_scatter-2.0.9-cp37-cp37m-win_amd64.whl
https://data.pyg.org/whl/torch-1.10.0%2Bcu113/torch_sparse-0.6.13-cp37-cp37m-win_amd64.whl
https://data.pyg.org/whl/torch-1.10.0%2Bcu113/torch_spline_conv-1.2.1-cp37-cp37m-win_amd64.whl

这几个版本的包。

5.安装torch-geometric,直接pip install torch-geometric会在import时报错,后在官网查看了一下,

You can now install PyG via Anaconda for all major OS, PyTorch and CUDA combinations 🤗 If you have not yet installed PyTorch, install it via conda as described in its official documentation. Given that you have PyTorch installed (>=1.12.0), simply run

及直接pip的torch-geometric是2.3.0版本,只支持torch1.12.0及以上版本,因此安装时需指定更低的版本才行,可以在 torch-geometric · PyP I

我选择了2.0,但安装torch-geometric时报错:Could not find a version that satisfies the requirement rdflib 找不到rdflib包,所以先装rdflib再装torch-geometric

pip install rdflib
pip install torch-geometric==2.0.0

安装后不再报错。

6.pip安装matplotlib时报错ERROR: Could not find a version that satisfies the requirement matplotlib (from versions: none),采用豆瓣源安装成功

pip install xxx -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

7.安装torch-geometric-temporal,需要几个依赖参考此链接。到这步完成基本就成功了,import 各个包试一下,不报错即可。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值