Win 7+Anaconda+tensorflow
Anaconda是一种拥有各种Python库的集成环境,也支持Windows、Mac和Linux系统。
1、安装 Anaconda
安装包:https://www.continuum.io/downloads。注意版本问题,我用的是64位系统。且目前Windows版本的TensorFlow只支持Python3.5以上。
2、安装 TensorFlow
打开 Anaconda Prompt,建立名为 tensorflow的 conda计算环境,输入:
conda create -n tensorflow python=3.5
安装完以后,激活 tensorflow 环境,输入:
activate tensorflow
激活后,我选择安装的是 CPU版本,输入:
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0-cp35-cp35m-win_amd64.whl
3、测试
- python
- >>import tensorflow as tf
- >>hello = tf.constant('Hello, Tensorflow!')
- >>sess = tf.Session()
- >>print(sess.run(hello))
- >>a = tf.constant(10)
- >>b = tf.constant(22)
- >>print(sess.run(a+b))