C/C++教程

PyTorch Geometric(图卷积)环境安装 —— GPU

本文主要是介绍PyTorch Geometric(图卷积)环境安装 —— GPU,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

1. 安装PyTorch

         进入 Pytorch 官网 pytorch.org,安装自己需要的版本。(我的是1.7.1版本  cuda11.0)

注意:Pytotch 最低为 1.4.0 以上

pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html

 2. 安装PyTorch Geometric

        官方链接:Installation — pytorch_geometric 2.0.0 documentation

  • 安装相关依赖库  

pip install --no-index torch-scatter -f https://pytorch-geometric.com/whl/torch-1.7.1+cu110.html
pip install --no-index torch-sparse -f https://pytorch-geometric.com/whl/torch-1.7.1+cu110.html
pip install --no-index torch-cluster -f https://pytorch-geometric.com/whl/torch-1.7.1+cu110.html
pip install --no-index torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.7.1+cu110.html
  • 安装 torch-geometric

pip install torch-geometric -f https://data.pyg.org/whl/torch-1.7.1+cu110.html

注意:上述相关依赖库 也可以进入官网下载后离线安装。网址:https://pytorch-geometric.com/whl/

3. 测试

        没有报错就说明安装成功了

python -c "import torch_geometric"

公众号:清纯世纪 

这篇关于PyTorch Geometric(图卷积)环境安装 —— GPU的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!