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))

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM