首先安装torch == 1.8.1+cu111
pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
然后再安装其他库
pip install torch-scatter==2.0.6 -f https://data.pyg.org/whl/torch-1.8.1+cu111.html
pip install torch-sparse==0.6.9 -f https://data.pyg.org/whl/torch-1.8.1+cu111.html
pip install torch-cluster==1.5.9 -f https://data.pyg.org/whl/torch-1.8.1+cu111.html
pip install torch-geometric==1.6.3
创建demo.py
echo "import torch
import torch_scatter
import torch_sparse
import torch_cluster
import torch_spline_conv
import torch_geometric
def print_version(module, name):
try:
print(f'{name} version: {module.__version__}')
except AttributeError:
print(f'{name} version could not be determined.')
def main():
print_version(torch, 'torch')
print_version(torch_scatter, 'torch-scatter')
print_version(torch_sparse, 'torch-sparse')
print_version(torch_cluster, 'torch-cluster')
print_version(torch_spline_conv, 'torch-spline-conv')
print_version(torch_geometric, 'torch-geometric')
if __name__ == '__main__':
main()
" > demo.py