维基百科上对Anaconda的介绍:
Anaconda is a freemium open source distribution of the Python and R programming languages for large-scale data processing, predictive analytics, and scientific computing, that aims to simplify package management and deployment. Package versions are managed by the package management system conda.
这里引出了conda的概念,再次百科一下conda:
Conda is an open source, cross-platform, language-agnostic package manager and environment management system that installs, runs, and updates packages and their dependencies.Conda allows users to easily
- install different versions of binary software packages and any required libraries appropriate for their computing platform
- switch between package versions
- download and install updates from a software repository.
Conda is written in the Python programming language, but can manage projects containing code written in other languages (e.g., R), including multi-language projects. Conda can install the Python programming language, while similar Python-based cross-platform package managers (such as wheel or pip) cannot.
遇到的一个小问题:百度TensorFlow搜出的英文官网打不开,需要emmmmmm…你懂得,喜迎党的十九大,一大批VPN又GG了。另外一个可以打开的网址:
Tensorflow
根据官网步骤:
1.Follow the instructions on the Anaconda download site to download and install Anaconda.
去Anaconda官网安装,选择了Python3.6-64bit版本
2.Create a conda environment named tensorflow by invoking the following command:
C:> conda create -n tensorflow python=3.5
打开Anaconda prompt,输入上述命令
3.然后按照提示输入命令激活TensorFlow环境
activate tensorflow
4.Issue the appropriate command to install TensorFlow inside your conda environment. To install the CPU-only version of TensorFlow, enter the following command:
(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow
继续在Anaconda Prompt中输入上述命令,install CPU版,暂时用不到GPU加速版
到了这步,TensorFlow已经安装完毕,接下来安装spyder编译器。
默认Anaconda已经安装了一个Spyder编译器,但是并不是TensorFlow环境下的,无法调用TensorFlow。
1.打开Anaconda Navigator
2.在主页面中选择Applications on TensorFlow,找到Spyder,Install
安装完毕,打开Spyder,输入代码验证:
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
没有报错,正确输出:b'Hello, TensorFlow!'
成功!
之后可能会用到GPU加速版,再做研究。