美文网首页我爱编程程序员
Windows64位安装CPU版TensorFlow

Windows64位安装CPU版TensorFlow

作者: Pirate_LHX | 来源:发表于2017-06-01 19:54 被阅读0次

    推荐使用powershell,只需要在cmd指令窗口输入powershell即可

    下载64位Python3.5(一定要3.5!!)可以通过Python 3.5 from python.orgPython 3.5 from Anaconda下载并安装Python3.5.2(注意选择正确的操作系统)。

    具体教程可以查看Python3.5.2百度经验安装,里面有个细节,自动设置环境变量,不能忘

    安装VS2015,如果是2013的后面要加个插件,这是后话

    为了使用国内镜像加速pip安装,需要如下修改:

    WIndows 7 在“C:\Users\用户名\AppData\Local\pip”文件夹下,新建文本文件,添加内容:

    关于镜像参考http://www.cnblogs.com/microman/p/6107879.html

    安装CPU版TensorFlow 0.12,Power Shell下输入:pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl

    安装GPU版TensorFlow 0.12,Power Shell下输入:pip install --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-0.12.0rc0-cp35-cp35m-win_amd64.whl

    装完后发现还是有问题:比如

    import tensorflow as tf

    报错为:

    Error importing tensorflow.  Unless you are using bazel,

    you should not try to import tensorflow from its source directory;

    please exit the tensorflow source tree, and relaunch your python interpreter

    from there.(这是因为装了VS2013原因,要是直接2015应该没事,所以要加补丁)

    解决方案:.进入https://www.tensorflow.org/versions/r0.12/get_started/os_setup.html#pip-installation-on-windows,点击下面图标下载vc_redist.x64.exe

    安装vc_redist.x64.exe,安装时会出现 “正在处理 windon_msu_x64”时,是因为window缺少补丁,下载地址为:http://pan.baidu.com/s/1nvpsXVN

    完毕 可以运行了

    然后基本就可以用了>>>import tensorflow as tf

    但是楼主在使用时发现Tensorflow的强大可视化工具Tensorboard无法用

    找了很久原因,终于在简书中找到一大神的说法,http://www.jianshu.com/p/4b92b19c97e2,原因就是版本的问题,对于Linux系统无论TensorFlow是0.12还是1.0都能很好的使用tensorboard;但是对于Windows系统,0.12是无法显示的,1.0版本的TensorFlow是能显示的,这个需要注意。

    于是开始更新0.12版本到1.0,命令很简单,还是powershell,pip3install--upgradetensorflow,具体链接见http://blog.csdn.net/u010099080/article/details/55260055

    相关文章

      网友评论

        本文标题:Windows64位安装CPU版TensorFlow

        本文链接:https://www.haomeiwen.com/subject/fhoefxtx.html