ubuntu安装pytorch-geometric

Environment

  • OS:ubuntu16.04
  • Python version:Python 3.6.8
  • PyTorch version:1.1.0
  • CUDA/cuDNN version:9.0.176
  • GCC version:5.4.0

检查

1 检查pytorch支持cuda

$ python -c "import torch; print(torch.cuda.is_available())"
>>> True

2 添加路径

$ export PATH=/usr/local/cuda/bin:$PATH
$ echo $PATH
>>> /usr/local/cuda/bin:...

$ export CPATH=/usr/local/cuda/include:$CPATH
$ echo $CPATH
>>> /usr/local/cuda/include:...
$ export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
$ echo $LD_LIBRARY_PATH
>>> /usr/local/cuda/lib64:...

$ export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH
$ echo $DYLD_LIBRARY_PATH
>>> /usr/local/cuda/lib:...

3 确认PyTorch与系统 CUDA 版本匹配

$ python -c "import torch; print(torch.version.cuda)"
>>> 9.0.176

$ nvcc --version
>>> 9.0.176

4 PIP安装

$ pip install --verbose --no-cache-dir torch-scatter==1.4.0
$ pip install --verbose --no-cache-dir torch-sparse==0.4.4
$ pip install --verbose --no-cache-dir torch-cluster
$ pip install --verbose --no-cache-dir torch-spline-conv (optional)
$ pip install torch-geometric

你可能感兴趣的:(深度学习,ubuntu)