PyTorch
2019-09-03.
Category & Tags:
Deep Learning,
PyTorch
Install (w/ GPU) #
win10 #
Install NV GPU driver and compatible CUDA version first, or install using pip together.
See PyTorch doc’s selector to find a compatible CUDA version.
Then use the cmd given by the selector to install PyTorch:
pip source: #
pip install pytorch torchvision torchaudio cudatoolkit=11.1
pip binary: #
pip3 install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio===0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
Tip: the torch...whl
file is > 3GB, which can be pre-downloaded via IDM etc., then:
pip3 install torch-1.9.0+cu111-cp39-cp39-win_amd64.whl torchvision==0.10.0+cu111 torchaudio===0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
conda: #
conda install pytorch torchvision torchaudio cudatoolkit=11.1
verify installation #
import torch
torch.cuda.is_available()
- 李沐 D2L
- PyTorch official 60-min tutorials.
- PyTorch 常见的坑汇总
- PyTorch 必备神器 | 唯快不破:基于 Apex 的混合精度加速
- 李沐《动手学深度学习》PyTorch 版,瞬间登上 GitHub 热榜!
- 从 PyTorch 到 PyTorch Lightning — 简要介绍 2020-03 代码不变,优化实验
- 高性能 PyTorch 是如何炼成的?过来人吐血整理的 10 条避坑指南
See also:
Fast.ai who is using PyTorch.
Install Libs with GPU/Cuda Support (e.g. GNN Libs) #
Tip: Compatible versions of GPU/Cuda and torch should be installed before the following cmds. (Those cmds can also be run within Pycharm’s venv “Terminal” in its UI to install into the venv.)
pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cu111.html &\
pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.9.0+cu111.html &\
pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-1.9.0+cu111.html &\
pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.9.0+cu111.html &\
pip install torch-geometric