torch + torch_geometric 安装

torch 1.13.1 + cuda 11.7

低于服务器安装的cuda版本即可,nvidia-smi查看

1
pip3 install torch==1.13.1+cu117 torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117

验证:

1
2
import torch
torch.cuda.is_available() # True

torch_geometric

https://pytorch-geometric.readthedocs.io/en/latest/install/installation.html

1
2
3
4
pip install torch_geometric

# Optional dependencies:
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-1.13.0+cu117.html

复制已有的conda环境

查看已有的环境

1
conda info --env

根据已有环境的路径复制

1
conda create -n [name] --clone [path]