pytorch安装、torch_geometric安装

  • pycharm连服务器
    https://www.jb51.net/article/220253.htm

  • torch torchvision python版本对应
    https://github.com/pytorch/vision#installation

  • torchaudio版本对应
    https://github.com/pytorch/audio

  • 选pytorch版本下载 (可根据cuda版本找)
    https://download.pytorch.org/whl/torch/

特别注意,使用pip install 安装时,会自动下载cpu的torch,卸载掉自己的cuda版本,解决办法是指令变为:pip install --no-deps 你的torchvision名称。但是这样安装后,导入会报错,缺一些库,比如numpy,pillow等,对应安装上就好。

检查cuda

import torch
torch.cuda.device_count()
torch.cuda.is_available()
torch.cuda.device_count()

解决No module named ‘torch_geometric‘报错的办法
参考:https://www.jb51.net/article/241128.htm
https://pytorch-geometric.com/whl/
pytorch 1.9.0 py3.9_cuda10.2_cudnn7.6.5_0

pip install https://data.pyg.org/whl/torch-1.9.0%2Bcu102/torch_cluster-1.5.9-cp39-cp39-linux_x86_64.whl
pip install https://data.pyg.org/whl/torch-1.9.0%2Bcu102/torch_scatter-2.0.8-cp39-cp39-linux_x86_64.whl
pip install https://data.pyg.org/whl/torch-1.9.0%2Bcu102/torch_sparse-0.6.12-cp39-cp39-linux_x86_64.whl
pip install https://data.pyg.org/whl/torch-1.9.0%2Bcu102/torch_spline_conv-1.2.1-cp39-cp39-linux_x86_64.whl
pip install torch_geometric

你可能感兴趣的:(配置,pytorch,深度学习,python)