linux下安装pytorch
1.到https://pytorch.org/
2.根据自己的情况,选择相应的
PyTorch Build Stable (1.8.1)
Your OS Linux
Package Pip
Language Python
Compute Platform CUDA 10.2
Run this Command: pip install torch torchvision torchaudio
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /opt/anaconda
added / updated specs:
- cudatoolkit=10.2
- pytorch
- torchaudio
- torchvision
The following packages will be downloaded:
package | build
---------------------------|-----------------
libidn2-2.3.1 | h27cfd23_0 85 KB
nettle-3.7.3 | hbbd107a_1 809 KB
pytorch-1.9.0 |py3.8_cuda10.2_cudnn7.6.5_0 705.2 MB pytorc
h
torchaudio-0.9.0 | py38 4.4 MB pytorch
torchvision-0.10.0 | py38_cu102 28.7 MB pytorch
------------------------------------------------------------
Total: 739.3 MB
The following NEW packages will be INSTALLED:
cudatoolkit pkgs/main/linux-64::cudatoolkit-10.2.89-hfd86e86_1
ffmpeg pytorch/linux-64::ffmpeg-4.3-hf484d3e_0
gnutls pkgs/main/linux-64::gnutls-3.6.15-he1e5248_0
lame pkgs/main/linux-64::lame-3.100-h7b6447c_0
libiconv pkgs/main/linux-64::libiconv-1.15-h63c8f33_5
libidn2 pkgs/main/linux-64::libidn2-2.3.1-h27cfd23_0
libtasn1 pkgs/main/linux-64::libtasn1-4.16.0-h27cfd23_0
libunistring pkgs/main/linux-64::libunistring-0.9.10-h27cfd23_0
nettle pkgs/main/linux-64::nettle-3.7.3-hbbd107a_1
ninja pkgs/main/linux-64::ninja-1.10.2-hff7bd54_1
openh264 pkgs/main/linux-64::openh264-2.1.0-hd408876_0
pytorch pytorch/linux-64::pytorch-1.9.0-py3.8_cuda10.2_cudnn7.6.5_0
torchaudio pytorch/linux-64::torchaudio-0.9.0-py38
torchvision pytorch/linux-64::torchvision-0.10.0-py38_cu102
Proceed ([y]/n)? y
Downloading and Extracting Packages
nettle-3.7.3 | 809 KB | ####################################### | 100%
pytorch-1.9.0 | 705.2 MB | ####################################### | 100%
torchvision-0.10.0 | 28.7 MB | ####################################### | 100%
torchaudio-0.9.0 | 4.4 MB | ####################################### | 100%
libidn2-2.3.1 | 85 KB | ####################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
3、等待安装成功即可
4.文档https://pytorch.org/docs/stable/index.html
5 中文:https://pytorch.org/docs/stable/index.html
sudo pacman -Syyu
yay -S anaconda
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
source /opt/anaconda/bin/activate
conda deactivate
conda update anaconda
anaconda-navigator
人就像是被蒙着眼推磨的驴子,生活就像一条鞭子;当鞭子抽到你背上时,你就只能一直往前走,虽然连你也不知道要走到什么时候为止,便一直这么坚持着。