一、安装pytorch和对应驱动

1 进入官网 pytorch.org,我安装的是1.9.0版本  cuda11.1

conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c conda-forge

二、安装torch- geometric

官方链接:Installation — pytorch_geometric 2.0.0 documentation

1、pip方式安装

安装相关依赖库

pip install --no-index torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cu111.html
pip install --no-index torch-sparse -f https://pytorch-geometric.com/whl/torch-1.9.0+cu111.html
pip install --no-index torch-cluster -f https://pytorch-geometric.com/whl/torch-1.9.0+cu111.html
pip install --no-index torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.9.0+cu111.html

安装torch-geometric

pip install torch-geometric

2、conda 方式安装

conda install pytorch-geometric -c rusty1s -c conda-forge

三、测试,没有报错就说明安装成功了

python -c "import torch_geometric"

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐