1.安装正确版本的pytorch和cudatoolkit
pytorch和cudatoolkit的安装过程参见博主另一博客
查看版本命令见下图:
2.安装对应版本的PyG库
安装命令见:
https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html
3. 安装torch-geometric-temporal
确定torch版本
import torch
print(torch.version)
1.11.0
nvcc -V 确定cuda的版本
pip uninstall torch-geometric torch-scatter torch-sparse torch-cluster torch-spline-conv
GPU版本
pip install torch-scatter torch-sparse torch-cluster torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.13.0+cu116.html
CPU版本
pip install torch-scatter torch-sparse torch-cluster torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.13.0+cpu.html
pip install torch-geometric
pip install torch-geometric-temporal