zoukankan      html  css  js  c++  java
  • Windows64位安装CPU版TensorFlow

    1. 推荐使用powershell,只需要在cmd指令窗口输入powershell即可
    2. 下载64位Python3.5(一定要3.5!!)可以通过Python 3.5 from python.org 或 Python 3.5 from Anaconda 下载并安装Python3.5.2(注意选择正确的操作系统)。
    3. 具体教程可以查看Python3.5.2百度经验安装,里面有个细节,自动设置环境变量,不能忘
    4. 安装VS2015,如果是2013的后面要加个插件,这是后话
    5. 为了使用国内镜像加速pip安装,需要如下修改:

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

    6. 关于镜像参考http://www.cnblogs.com/microman/p/6107879.html
    7. 安装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
    8. 安装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  
    9. 装完后发现还是有问题:比如

      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应该没事,所以要加补丁)

    10. 解决方案:.进入https://www.tensorflow.org/versions/r0.12/get_started/os_setup.html#pip-installation-on-windows,点击下载vc_redist.x64.exe
    11. 安装vc_redist.x64.exe,安装时会出现 “正在处理 windon_msu_x64”时,是因为window缺少补丁,下载地址为:http://pan.baidu.com/s/1nvpsXVN

      完毕 可以运行了

    12. 然后基本就可以用了>>>import tensorflow as tf  
    13. 但是楼主在使用时发现Tensorflow的强大可视化工具Tensorboard无法用
    14. 找了很久原因,终于在简书中找到一大神的说法,http://www.jianshu.com/p/4b92b19c97e2,原因就是版本的问题,对于Linux系统无论TensorFlow是0.12还是1.0都能很好的使用tensorboard;但是对于Windows系统,0.12是无法显示的,1.0版本的TensorFlow是能显示的,这个需要注意。
    15. 于是开始更新0.12版本到1.0,命令很简单,还是powershell,pip3 install --upgrade tensorflow,具体链接见http://blog.csdn.net/u010099080/article/details/55260055
  • 相关阅读:
    夺命雷公狗---PDO NO:9 使用PDO准备语句并执行语句3
    夺命雷公狗---PDO NO:9 使用PDO准备语句并执行语句2
    [LeetCode] Lowest Common Ancestor of a Binary Search Tree
    二叉树
    LeetCode Palindrome LinkList
    LeetCode Same Tree
    LeetCode Merge Sorted List
    LeetCode Remove Duplicated from Sorted List
    LeetCode Climbing Stairs
    LeetCode Count And Say
  • 原文地址:https://www.cnblogs.com/xlqtlhx/p/6930496.html
Copyright © 2011-2022 走看看