anaconda+pytorch安装

1. anaconda安装

官网下载Anaconda3-5.0.1-MacOSX-x86_64.pkg 点击安装

安装完成后,可以使用anaconda navigator,包括jupyter和spyder

2. pytorch安装

官网的点击是无响应的,根据提示使用终端,输入

conda install pytorch=0.2.0 -c soumith

询问是否确定安装并且对响应对包update,选择y,回车。

安装完毕,如下

 

Fetching package metadata ………….

Solving package specifications: .

 

Package plan for installation in environment /Users/Anenyang/anaconda3:

 

The following NEW packages will be INSTALLED:

 

    pytorch:  0.2.0-py36_4cu75      soumith

 

The following packages will be UPDATED:

 

    anaconda: 5.0.1-py36h6e48e2d_1          –> custom-py36ha4fed55_0

    conda:    4.3.30-py36h173c244_0         –> 4.4.8-py36_0         

    pycosat:  0.6.2-py36h1486600_0          –> 0.6.3-py36hee92d8f_0 

 

Proceed ([y]/n)? y

 

anaconda-custo 100% |################################| Time: 0:00:00   1.38 MB/s

pycosat-0.6.3- 100% |################################| Time: 0:00:00 113.86 kB/s

pytorch-0.2.0- 100% |################################| Time: 0:00:29 172.88 kB/s

conda-4.4.8-py 100% |################################| Time: 0:00:32  29.42 kB/s

 

3. 问题

使用conda install pytorch=0.2.0 -c soumith这个命令只是安装torch(指定版本),而没有torchvision

 

使用conda install pytorch torchvision -c soumith将会安装torch 和 torchvision

没有cuda就不指定其版本,且不需要指定python的版本,具体安装如下:

 

anenyangdeMacBook-Air:~ Anenyang$ conda install pytorch torchvision -c soumith

Solving environment: done

 

## Package Plan ##

 

  environment location: /Users/Anenyang/anaconda3

 

  added / updated specs: 

    – pytorch

    – torchvision

 

 

The following packages will be downloaded:

 

    package                    |            build

    —————————|—————–

    certifi-2018.1.18          |           py36_0         143 KB

    torchvision-0.1.9          |           py36_1          86 KB  soumith

    openssl-1.0.2n             |       hdbc3d79_0         3.4 MB

    ————————————————————

                                           Total:         3.6 MB

 

The following NEW packages will be INSTALLED:

 

    torchvision: 0.1.9-py36_1               soumith

 

The following packages will be UPDATED:

 

    certifi:     2017.7.27.1-py36hd973bb6_0         –> 2018.1.18-py36_0 

    openssl:     1.0.2l-h57f3a61_2                  –> 1.0.2n-hdbc3d79_0

 

Proceed ([y]/n)? y

 

 

Downloading and Extracting Packages

certifi 2018.1.18: ########################################################################################### | 100% 

torchvision 0.1.9: ########################################################################################### | 100% 

openssl 1.0.2n: ############################################################################################## | 100% 

Preparing transaction: done

Verifying transaction: done

Executing transaction: done

    原文作者:pytorch
    原文地址: https://www.cnblogs.com/anenyang/p/8377424.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞