一定要按照官网的安装步骤来,否则安装完再导入包时很可能出现DLL链接错误。
具体安装步骤:
首先命令行查看自己电脑安装的pytorch
和cuda
版本:
python -c "import torch; print(torch.__version__)"
python -c "import torch; print(torch.version.cuda)"
之后下载对应版本的torch_geometric
四个依赖包:
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.9.1+cu102.html
pip install torch-sparse -f https://data.pyg.org/whl/torch-1.9.1+cu102.html
pip install torch-cluster -f https://data.pyg.org/whl/torch-1.9.1+cu102.html
pip install torch-spline-conv -f https://data.pyg.org/whl/torch-1.9.1+cu102.html
最后安装torch-geometric
:
pip install torch-geometric
官网链接:
https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html