windows 10 下安装 tensorflow
本文主要介绍windows 10 下基于Anaconda环境安装tensorflow及一些库的安装方法。
首先下载 Anaconda, Anaconda下载地址是https://www.anaconda.com/download/,请下载64位版本
运行下载到的文件
Anaconda开始安装,安装完毕后会看到Anaconda Prompt
运行Anaconda Prompt
在命令行输入conda create -n tensorflow_work python=3.5,创建tensorflow环境
出现 Proceed([y]/n)? 输入y
安装完毕后输入activate tensorflow_work,注意提示符的变化
需要确认python 版本是64位的,tensorflow要求64位的 python
接下来开始安装tensorflow,注意我们不用tensorflow官网使用的pip指令, 而是使用conda指令,我这里选择cpu版本,也可以安装gpu版本
cpu版本
conda install tensorflow
gpu版本
conda install tensorflow-gpu
出现选择提示后需要选择y
到此tensorflow 已成功安装,接下来我们再安装几个库。
conda install numpy
conda install pandas
conda install matplotlib
安装sklearn库
conda install scikit-learn
接下来就可以愉快的使用了tensorflow了
执行python,输入代码测试一下
>>>import tensorflow as tf >>> hello = tf.constant('Hello, TensorFlow!') >>> sess = tf.Session() >>> print(sess.run(hello))
tensorboard 是google提供的tensorflow 工具,使用过程中有几个注意事项,我自己的尝试了多次才可以正常使用的。
注意事项1 :tensorboard --logdir=E:\tensorflowTUT\tf17_dropout\logs 需要完整的log目录路径,路径名纯英文最好不要有空格及汉字
注意事项2:浏览器最好用Google的 Chrome