anaconda下安装torch_geometric

官方文档
安装的时候出了很多错误,最后还是按照官网文档才安装好了

pytorch的版本

确定pytorch的版本,最低1.4.0

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

CUDA的版本

确定cuda的版本

python -c "import torch; print(torch.version.cuda)"
>>> 10.2

安装包

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

将其中${TORCH}${CUDA}替换为第一二步确定的torch和cuda版本。

pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.8.0+cu102.html
pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.8.0+cu102.html
pip install torch-geometric

Guess you like

Origin blog.csdn.net/qq_37252519/article/details/119379232