1.首先查看cuda版本
命令nvidia-smi
检测到cuda11.6
2.新建虚拟环境
conda create -n torch12 python=3.7
3.下载对应版本的pytorch(正常情况下可以向下兼容,但geometric要求版本torch与cuda一致)
pip install torch1.12.0+cu116 torchvision0.13.0+cu116 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu116
4.确定pytorch的版本,最低1.4.0
python -c “import torch; print(torch.version)”
1.12.0
5.确定cuda的版本
python -c “import torch; print(torch.version.cuda)”
11.6
6.安装包
pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.12.0+cu116.html
pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.12.0+cu116.html
pip install torch-geometric
7.将会看到
Successfully built torch-geometric
Installing collected packages: tqdm, threadpoolctl, pyparsing, psutil, MarkupSafe, joblib, scikit-learn, jinja2, torch-geometric
Successfully installed MarkupSafe-2.1.2 jinja2-3.1.2 joblib-1.2.0 psutil-5.9.4 pyparsing-3.0.9 scikit-learn-1.0.2 threadpoolctl-3.1.0 torch-geometric-2.2.0 tqdm-4.64.1
服务器ubuntu20.04 安装torch_geometric
最新推荐文章于 2024-05-04 21:23:39 发布