一、pytorch环境创建
1.打开Anaconda Prompt,输入命令
conda create -n pytorch python=3.8
进入环境
activate ‘name’
二、环境查询
import torch
print(torch.__version__)
print(torch.version.cuda)
二、下载依赖
打开网址:pytorch-geometric.com/whl/
cp后面是python版本号
利用pip进行依赖下载:(复制链接即可)
pip insatll https://data.pyg.org/whl/torch-1.11.0%2Bcu115/torch_cluster-1.6.0-cp39-cp39-win_amd64.whl
pip install https://data.pyg.org/whl/torch-1.11.0%2Bcu115/torch_scatter-2.0.9-cp39-cp39-win_amd64.whl
pip install https://data.pyg.org/whl/torch-1.11.0%2Bcu115/torch_spline_conv-1.2.1-cp39-cp39-win_amd64.whl
三、pytorch_geometric安装
主要不要直接:pip install torch_geometric
这样会安装最新的torch_geometric,后面在使用时候会出现Pytorch AttributeError: module 'torch' has no attribute 'sparse_scs'
这里手动指定低版本安装:
pip install torch_geometric==2.0.