安装记录

PyTorch Install

$ sudo yum update
$ cat /etc/redhat-release 
CentOS Linux release 7.9.2009 (Core)

$ sudo yum groupinstall "Development Tools"
$ sudo yum install python3

$ curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
$ sh Miniconda3-latest-Linux-x86_64.sh
$ source ~/.bashrc

$ conda install pytorch torchvision torchaudio cpuonly -c pytorch


$ cat verifying.py 
import torch

print(torch.__version__)

x = torch.rand(5, 3)
print(x)


$ python verifying.py 
1.10.0
tensor([[0.7612, 0.7049, 0.1622],
        [0.8425, 0.9054, 0.0477],
        [0.1192, 0.5552, 0.1462],
        [0.5495, 0.8737, 0.4740],
        [0.7895, 0.7944, 0.4775]])