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版本,输入:

3、测试

  1. python  
  2. >>import tensorflow as tf  
  3. >>hello = tf.constant('Hello, Tensorflow!')  
  4. >>sess = tf.Session()  
  5. >>print(sess.run(hello))  
  6. >>a = tf.constant(10)  
  7. >>b = tf.constant(22)  
  8. >>print(sess.run(a+b))

 

posted @ 2017-04-27 10:24  鹤顶一支草  阅读(1567)  评论(0编辑  收藏  举报