Python3.8+Pytorch1.0+CUDA11.1环境配置+安装pytorch-geometric

1. conda创建环境

conda create -n gnn python==3.8

2. 安装pytorch

pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html

3. 验证cuda是否安装成功

torch.cuda.is_available()

4. 安装pytorch-geometric

#安装scatter包
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.9.0%2Bcu111.html
#安装sparse包
pip install torch-sparse -f https://data.pyg.org/whl/torch-1.9.0%2Bcu111.html
#安装pytoch_geometric
pip install torch-geometric

如果fail的话可以在https://data.pyg.org/whl/torch-1.9.0%2Bcu111.html里离线下载这两个包,然后本地安装,这里示例是我的D盘

pip install D:\Users\aj\torch_sparse-0.6.10-cp38-cp38-win_amd64.whl

5. 最后验证安装成功

import torch_geometric

ps.几个前提命令

#查看cuda版本
nvidia-smi
#pytorch版本选择
https://pytorch.org/get-started/previous-versions/

你可能感兴趣的:(pytorch,深度学习,python)