https://pytorch.org/get-started/previous-versions/
conda create -n py37 python=3.7
conda activate py37
conda search cudnn
conda install cudatoolkit=11.1
conda install cudnn=8.2.1=cuda11.3_0
sudo apt-get install cuda
conda install cudatoolkit=10.2
conda install cudnn=7.6.5=cuda10.2_0
conda install -c conda-forge/label/cf202003 nvcc_linux-64
# CUDA 11.6
pip install torch==1.12.1+cu116 torchvision==0.13.1+cu116 torchaudio==0.12.1 --extra-index-url <https://download.pytorch.org/whl/cu116>
# CUDA 11.3
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url <https://download.pytorch.org/whl/cu113>
# CUDA 11.1
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>
# CUDA 10.2
pip install torch==1.12.1+cu102 torchvision==0.13.1+cu102 torchaudio==0.12.1 --extra-index-url <https://download.pytorch.org/whl/cu102>
# CUDA 10.2
pip install torch==1.8.1+cu102 torchvision==0.9.1+cu102 torchaudio==0.8.1 -f <https://download.pytorch.org/whl/torch_stable.html>
# CUDA 10.1
pip install torch==1.8.1+cu101 torchvision==0.9.1+cu101 torchaudio==0.8.1 -f <https://download.pytorch.org/whl/torch_stable.html>
# CPU only
pip install torch==1.12.1+cpu torchvision==0.13.1+cpu torchaudio==0.12.1 --extra-index-url <https://download.pytorch.org/whl/cpu>
# CPU only
pip install torch==1.8.1+cpu torchvision==0.9.1+cpu torchaudio==0.8.1 -f <https://download.pytorch.org/whl/torch_stable.html>
pip install poetry
poetry init
poetry source add --priority=explicit pytorch-gpu-src <https://download.pytorch.org/whl/cu118>
poetry add --source pytorch-gpu-src torch torchvision torchaudio
[tool.poetry.dependencies]
python = ">=3.9, <3.11"
torch = {version = "^2.0.1+cu118", source = "pytorch-gpu-src"}
torchvision = {version = "^0.15.2+cu118", source = "pytorch-gpu-src"}
torchaudio = {version = "^2.0.2+cu118", source = "pytorch-gpu-src"}