win7 64位环境下 TensorFlow的安装
我的电脑配置:
- 系统 :Windows7 64位
- CPU :Intel(R) Core(TM)i3-3470 @3.2GHz
- 安装内存:8G
- 显卡 :AMD Radeon HD 7470
一、安装Python3.5
Windows下安装TensorFlow只支持Python3.5以上的版本,所以安装Python3.5,Python的安装可以从官网下载,Python
3.5 from python.org
Winddows7安装Python3.5时会遇到问题,如下图:
Python安装完成之后可以在开始菜单里查看。
上面两个一个是IDLE集成开发环境,一个是普通编译器,和CMD在看着一样。
二、安装,vc_redist.x64.exe
下载地址vc_redist.x64.exe下载地址,安装完成之后安装TensorFlow。
三、安装TensorFlow
TensorFlow的安装有GPU和CPU两个不同版本,我的GPU不行,所以我安装的是CPU的版本。
采用的输入Shell指令进行安装,
CPU版:
- pip3 install tensorflow
GPU版:
- pip3 install tensorflow-gpu
打开“Python3.5”,输入以下测试程序:
- >>> import tensorflow as tf
- >>> hello = tf.constant('Hello, TensorFlow!')
- >>> sess = tf.Session()
- >>> print(sess.run(hello))
- Hello, TensorFlow!
- >>> a = tf.constant(10)
- >>> b = tf.constant(32)
- >>> print(sess.run(a + b))
- 42
- >>