<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>陈军</title>
    <description>欢迎来到我的个人站~</description>
    <link>https://cehnjun.github.io/</link>
    <atom:link href="https://cehnjun.github.io/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Sun, 17 Dec 2017 12:55:30 +0000</pubDate>
    <lastBuildDate>Sun, 17 Dec 2017 12:55:30 +0000</lastBuildDate>
    <generator>Jekyll v3.6.2</generator>
    
      <item>
        <title>Tensorflow-GPU-Win10安装</title>
        <description>&lt;hr /&gt;
&lt;h3 id=&quot;1-vs2015安装&quot;&gt;1. VS2015安装&lt;/h3&gt;
&lt;p&gt;要编译 &lt;strong&gt;CUDA&lt;/strong&gt; 里的例子工程可以安装 &lt;strong&gt;VS2015&lt;/strong&gt; ，不安装对于使用 &lt;strong&gt;tensorflow-gpu&lt;/strong&gt; 没有影响，建议先安装 &lt;strong&gt;VS2015&lt;/strong&gt; 以备后续使用例子需要。去官网下载 &lt;strong&gt;VS2015&lt;/strong&gt; ，选择 &lt;strong&gt;C++&lt;/strong&gt; 模块安装即可。按照官网说明匹配相应的 &lt;strong&gt;Compiler&lt;/strong&gt; 即可，不用一定是 &lt;strong&gt;VS2015&lt;/strong&gt; ：&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/posts/markdown/CUDA1.PNG&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;2-cuda安装&quot;&gt;2. CUDA安装&lt;/h3&gt;
&lt;p&gt;本文作者在安装 &lt;strong&gt;tensorflow-gpu&lt;/strong&gt; 时，tenforflow-gpu支持的 &lt;strong&gt;CUDA&lt;/strong&gt; 最高版本还是  &lt;a href=&quot;https://developer.nvidia.com/cuda-toolkit-archive&quot;&gt;CUDA Toolkit 8.0 - Feb 2017&lt;/a&gt;，去官网下载相应安装程序默认安装即可。可以到&lt;a href=&quot;https://developer.nvidia.com/cuda-gpus&quot;&gt;CUDA-Enabled GeForce Products&lt;/a&gt;查看GPU支持，环境变量由安装程序默认配置好。(安装路径不用管，即使改了路径，依然会安装在 &lt;strong&gt;C&lt;/strong&gt; 盘路径)&lt;/p&gt;

&lt;h3 id=&quot;3-cudnn安装&quot;&gt;3. cuDNN安装&lt;/h3&gt;
&lt;p&gt;官网下载相应 &lt;strong&gt;CUDA&lt;/strong&gt; 版本的 &lt;strong&gt;cudnn-8.0-windows10-x64-v6.0.zip&lt;/strong&gt; 解压文件，将得到的三个文件夹(&lt;em&gt;/bin,/include,/lib&lt;/em&gt; )覆盖至 &lt;strong&gt;CUDA&lt;/strong&gt; 安装目录&lt;/p&gt;
&lt;blockquote&gt;

  &lt;p&gt;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;4-tensorflow-gpu安装&quot;&gt;4. Tensorflow-gpu安装&lt;/h3&gt;
&lt;p&gt;按照官网教程&lt;a href=&quot;https://tensorflow.google.cn/install/install_windows&quot;&gt;Installing TensorFlow on Windows&lt;/a&gt;安装，本文选择 &lt;strong&gt;Installing with Anaconda3&lt;/strong&gt;，使用清华镜像安装 &lt;a href=&quot;https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/&quot;&gt;Anaconda&lt;/a&gt;，添加清华镜像仓库源。打开 &lt;strong&gt;Anaconda Prompt&lt;/strong&gt; 输入:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;:conda create -n tensorflow-gpu python=3.5 #创建Python虚拟环境
:activate tensorflow-gpu #激活tensorflow-gpu环境
:pip install --ignore-installed --upgrade tensorflow-gpu #pip安装
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;本文使用 &lt;strong&gt;Python3.6&lt;/strong&gt; 安装时出错，采用 &lt;strong&gt;Python3.5&lt;/strong&gt; 安装，如果在创建虚拟环境时出错，提示网络问题，找到 &lt;em&gt;.condarc&lt;/em&gt; 文件(使用 &lt;strong&gt;everthing&lt;/strong&gt; 搜索方便)，删除 &lt;strong&gt;-default&lt;/strong&gt; 一行。(前面已添加清华镜像仓库源)&lt;/p&gt;

&lt;h3 id=&quot;5-测试mnist数据集&quot;&gt;5. 测试MNIST数据集&lt;/h3&gt;
&lt;p&gt;激活 &lt;strong&gt;tensorflow-gpu&lt;/strong&gt; 虚拟环境后,下载 &lt;strong&gt;mnist&lt;/strong&gt; 测试集(手写数字识别):&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;:git clone https://github.com/martin-gorner/tensorflow-mnist-tutorial.git
:python mnist_1.0_softmax.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;首次运行如果出错，提示网络连接中断，一般是数据集下载中断，需要借助梯子上网。成功后如下显示使用 &lt;strong&gt;GPU&lt;/strong&gt; 设备：
&lt;strong&gt;（/device:GPU:0）&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/posts/markdown/MNIST1.PNG&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/posts/markdown/MNIST2.PNG&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
</description>
        <pubDate>Sun, 17 Dec 2017 00:00:00 +0000</pubDate>
        <link>https://cehnjun.github.io/2017/12/Tensorflow_1_Win10_GPU%E7%89%88%E6%9C%AC%E5%AE%89%E8%A3%85/</link>
        <guid isPermaLink="true">https://cehnjun.github.io/2017/12/Tensorflow_1_Win10_GPU%E7%89%88%E6%9C%AC%E5%AE%89%E8%A3%85/</guid>
        
        <category>博客</category>
        
        
      </item>
    
      <item>
        <title>Jekyll搭建个人博客</title>
        <description>&lt;p&gt;此&lt;strong&gt;jekyll&lt;/strong&gt;模板&lt;strong&gt;fork&lt;/strong&gt;自 &lt;a href=&quot;https://github.com/leopardpan/leopardpan.github.io&quot;&gt;潘柏信&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;本机在本地部署时，在&lt;strong&gt;bundler&lt;/strong&gt;安装好后，使用以下命令代替&lt;strong&gt;jekyll server&lt;/strong&gt;开启本地部署服务:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bundle exec jekyll server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Thu, 30 Nov 2017 00:00:00 +0000</pubDate>
        <link>https://cehnjun.github.io/2017/11/jekyllBlog/</link>
        <guid isPermaLink="true">https://cehnjun.github.io/2017/11/jekyllBlog/</guid>
        
        <category>博客</category>
        
        
      </item>
    
  </channel>
</rss>
