我的操作系统是CentOS 7,我想安装PyTorch,所以我做了以下事情:
(pt_gpu) [martin@A08-R32-I196-3-FZ2LTP2 mlm]$ conda -V
conda 4.6.2
(pt_gpu) [martin@A08-R32-I196-3-FZ2LTP2 mlm]$ conda install -c anaconda pytorch-gpu
奇怪的是,安装消息显示它正在安装非常旧的PyTorch版本:
Collecting package metadata: done
Solving environment: done
## Package Plan ##
environment location: /home/martin/anaconda3/envs/pt_gpu
added / updated specs:
- pytorch-gpu
The following packages will be downloaded:
package | build
---------------------------|-----------------
ca-certificates-2018.12.5 | 0 123 KB anaconda
certifi-2018.11.29 | py36_0 146 KB anaconda
pytorch-gpu-0.1.12 | py36_0 16.8 MB anaconda
------------------------------------------------------------
Total: 17.0 MB
The following packages will be UPDATED:
openssl pkgs/main::openssl-1.1.1a-h7b6447c_0 --> anaconda::openssl-1.1.1-h7b6447c_0
The following packages will be SUPERSEDED by a higher-priority channel:
ca-certificates pkgs/main --> anaconda
certifi pkgs/main --> anaconda
mkl pkgs/main::mkl-2017.0.4-h4c4d0af_0 --> anaconda::mkl-2017.0.1-0
pytorch-gpu pkgs/free --> anaconda
Proceed ([y]/n)? y
Downloading and Extracting Packages
certifi-2018.11.29 | 146 KB | ########################################################################################################################## | 100%
ca-certificates-2018 | 123 KB | ########################################################################################################################## | 100%
pytorch-gpu-0.1.12 | 16.8 MB | ########################################################################################################################## | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
要验证安装了什么,我做了:
(pt_gpu) [martin@A08-R32-I196-3-FZ2LTP2 mlm]$ python -c "import torch; print(torch.__version__)"
0.1.12
那是为什么?
答案 0 :(得分:1)
根据他们的官方网站(https://pytorch.org),他们安装了名为pytorch而不是pytorch-gpu的软件包。
conda install pytorch torchvision -c pytorch