windows 7 安装tensorFlow

来源:互联网 发布:网页数据采集 编辑:程序博客网 时间:2024/06/07 08:23

总结为以后使用方便,部分摘自 http://blog.csdn.net/include1224/article/details/53452

要求:python3.5   cuda8  cudnn5 

一、Python3.5

       TensorFlow在Windows上只支持64位Python3.5,可以通过Python 3.5 from python.org 或 Python 3.5 from Anaconda 下载并安装Python3.5.2

       安装后,将Python安装路径下“%安装路径%\Scripts”添加到Path下

二、安装Cuda和CuDNN(CPU版本T忽略本步骤)

       cuda安装版本cuda_8.0.44_windows.exe:https://developer.nvidia.com/cuda-downloads

         cudnn安装版本cudnn-8.0-windows7-x64-v5.0-ga.zip:https://developer.nvidia.com/cudnn(cuda历史各个版本下载链接 https://developer.nvidia.com/cuda-toolkit-archive

三、修改Pip国内源

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

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

[html] view plain copy
  1. [global]  
  2. index-url = http://mirrors.aliyun.com/pypi/simple/  
  3. [install]  
  4. trusted-host=mirrors.aliyun.com  

       关于修改pip国内源可参考这里

四、安装TensorFlow

         安装CPU版TensorFlow 0.12,Power Shell下输入:

[html] view plain copy
  1. 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下输入:

[html] view plain copy
  1. pip install --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-0.12.0rc0-cp35-cp35m-win_amd64.whl  

五、测试TensorFlow

       cmd,出现命令窗口,输入测试代码:

       python

       import tensorflow

       无错误提示即可


原创粉丝点击