{"id":811,"date":"2018-11-21T23:16:04","date_gmt":"2018-11-21T14:16:04","guid":{"rendered":"http:\/\/www.ecobioinfo.com\/?p=811"},"modified":"2022-06-05T22:53:34","modified_gmt":"2022-06-05T13:53:34","slug":"%e6%b7%b1%e5%b1%a4%e5%ad%a6%e7%bf%92-tensorflow-windows%e7%89%88-gpu-%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab","status":"publish","type":"post","link":"https:\/\/www.ecobioinfo.com\/?p=811","title":{"rendered":"\u6df1\u5c64\u5b66\u7fd2 TensorFlow Windows\u7248 GPU \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},"content":{"rendered":"<p>Tensorflow Winows \u7248\u3067\u3082 GPU\u3092\u5c0e\u5165\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\uff1c\uff1c\uff1c\u3000\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u3000\uff1e\uff1e\uff1e<\/p>\n<p>\u30cf\u30fc\u30c9\uff1a\u30de\u30a6\u30b9\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc LM-iH700B2N<br \/>\nCPU\uff1a IntelR Core? i3-8100 CPU @ 3.60GHz \u00d7 4<br \/>\n\u30e1\u30e2\u30ea\uff1a 4 GByte<br \/>\n\u672c\u4f53\u96fb\u6e90\uff1a 500W<br \/>\n\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30dc\u30fc\u30c9\uff1aNVIDIA GEFORCE GTX960 \u30e1\u30e2\u30ea 4GB<\/p>\n<p>OS\uff1a Windows 10 Home 64bit<\/p>\n<p>(1) \u30c7\u30d0\u30a4\u30b9\u30c9\u30e9\u30a4\u30d0\u30fc<\/p>\n<p>\u30b7\u30b9\u30c6\u30e0 &gt; \u30c7\u30a3\u30b9\u30d7\u30ec\u30a4 &gt; \u30a2\u30c0\u30d7\u30bf\u30fc\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u8868\u793a\u3001\u300c\u30a2\u30c0\u30d7\u30bf\u300d\u30bf\u30d6<\/p>\n<p>NVIDIA GeForce GTX 960 \u3068\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<p>\u30d7\u30ed\u30d1\u30c6\u30a3 &gt;\u30c9\u30e9\u30a4\u30d0 &gt; \u30c9\u30e9\u30a4\u30d0\u306e\u66f4\u65b0 &gt;\u300c\u30c9\u30e9\u30a4\u30d0\u306e\u6700\u65b0\u60c5\u5831\u3092\u81ea\u52d5\u691c\u7d22\u300d\u3092\u9078\u629e\u3002\u6700\u65b0\u306e\u30c9\u30e9\u30a4\u30d0\u304c\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u308b\u3002<\/p>\n<p>(2) GPU CUDA + cuDNN \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<p>\u53c2\u8003<br \/>\n<a href=\"https:\/\/www.tensorflow.org\/install\/\">https:\/\/www.tensorflow.org\/install\/<\/a><br \/>\n<a href=\"https:\/\/www.tensorflow.org\/install\/gpu\">https:\/\/www.tensorflow.org\/install\/gpu<\/a><\/p>\n<p>CUDA\u95a2\u4fc2\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\n<a href=\"https:\/\/docs.nvidia.com\/cuda\/cuda-installation-guide-microsoft-windows\/\">https:\/\/docs.nvidia.com\/cuda\/cuda-installation-guide-microsoft-windows\/<\/a><br \/>\n<a href=\"https:\/\/developer.nvidia.com\/cuda-downloads\">https:\/\/developer.nvidia.com\/cuda-downloads<\/a><\/p>\n<p>CUDA10 \u306e Windows10 64bit \u3092\u9078\u629e\u3001cuda_10.0.130_win10_network.exe \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3001\u8d77\u52d5\u3002<\/p>\n<p>Visual Studio \u304c\u5fc5\u8981\u3089\u3057\u3044\u306e\u3067\u3001VS Comminuty 2017 \u3092<\/p>\n<p><a href=\"https:\/\/visualstudio.microsoft.com\/ja\/vs\/community\/\">https:\/\/visualstudio.microsoft.com\/ja\/vs\/community\/<\/a>\u3000\u304b\u3089\u3001<\/p>\n<p>vs_community__1677739048.1538213643.exe\uff08.NET\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u958b\u767a\u3001C++\u306b\u3088\u308b\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u958b\u767a\u3001\u30e6\u30cb\u30d0\u30fc\u30b5\u30eb\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u958b\u767a\u3001Python\u958b\u767a\u3001\u3092\u9078\u629e\uff09<\/p>\n<p>\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u3001CUDA\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<p>cuDNN\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<p><a href=\"https:\/\/developer.nvidia.com\/cudnn\">https:\/\/developer.nvidia.com\/cudnn<\/a>\uff08\u30ed\u30b0\u30a4\u30f3\u304c\u5fc5\u8981\uff09<\/p>\n<p>Download cuDNN v7.4.1 (Nov 8, 2018), for CUDA 10.0<br \/>\ncuDNN Library for Windows 10 \u3092\u9078\u629e\u3002<\/p>\n<p>cudnn-10.0-windows10-x64-v7.3.1.20.zip<\/p>\n<p>\u5c55\u958b<\/p>\n<p>\u53c2\u8003\uff1a\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30ac\u30a4\u30c9<br \/>\n<a href=\"https:\/\/docs.nvidia.com\/deeplearning\/sdk\/cudnn-install\/index.html\">https:\/\/docs.nvidia.com\/deeplearning\/sdk\/cudnn-install\/index.html<\/a><br \/>\n\u30d1\u30b9\u3092\u8a2d\u5b9a\u3002<br \/>\nVariable Name: CUDA_PATH<br \/>\nVariable Value: C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.0<\/p>\n<p>\u30b3\u30d4\u30fc<br \/>\ncuda\\bin\\cudnn64_7.dll \u3092 C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.0\\bin. \u3078\u30b3\u30d4\u30fc<br \/>\ncuda\\ include\\cudnn.h \u3092 C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.0\\include. \u3078\u30b3\u30d4\u30fc<br \/>\ncuda\\lib\\x64\\cudnn.lib \u3092 C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.0\\lib\\x64. \u3078\u30b3\u30d4\u30fc<\/p>\n<p>(3) Anaconda \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u30b5\u30a4\u30c8<br \/>\n<a href=\"https:\/\/www.anaconda.com\/download\/#windows\">https:\/\/www.anaconda.com\/download\/#windows<\/a><br \/>\nAnaconda 5.3.1 For Windows Installer &gt; Python 3.7 version &gt; 64-Bit Graphical Installer \u3092\u9078\u629e<\/p>\n<p>Anaconda3-5.3.1-Windows-x86_64.exe \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3001\u8d77\u52d5\u3002\u3042\u3068\u306f\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u30fc\u306e\u901a\u308a\u3002<\/p>\n<p>Anaconda Prompt\u304b\u3089\u4eee\u60f3\u74b0\u5883\u306e\u4f5c\u6210<\/p>\n<p>conda create -n tf python=3.6<br \/>\nconda activate tf<\/p>\n<p>(4) Tensorflow GPU \u7248\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<p>&gt;pip install tensorflow-gpu<\/p>\n<p>\u307e\u305a\u3001pip\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff08\u5f8c\u8ff0\u306e\u901a\u308a\u3001\u554f\u984c\u304c\u3042\u3063\u305f\u306e\u3067conda\u3067\u3084\u308a\u306a\u304a\u3057\u305f\u3002\uff09<\/p>\n<p>&gt;python<br \/>\n&gt;&gt;&gt;import tensorflow<br \/>\n\u30fb\u30fb\u30fb\u30fb<br \/>\nImportError: DLL load failed: \u6307\u5b9a\u3055\u308c\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002<br \/>\n&gt;&gt;&gt;<\/p>\n<p>\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u306e\u3067\u3001\u30cd\u30c3\u30c8\u3067\u691c\u7d22\u3057\u3066\u89e3\u6c7a\u7b56\u3092\u63a2\u3059\u3002<\/p>\n<p>\u53c2\u8003<br \/>\n<a href=\"https:\/\/ja.stackoverflow.com\/questions\/42572\/pillow\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\u304c\u3067\u304d\u306a\u3044-dll-load-failed-\u6307\u5b9a\u3055\u308c\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\">https:\/\/ja.stackoverflow.com\/questions\/42572\/pillow\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\u304c\u3067\u304d\u306a\u3044-dll-load-failed-\u6307\u5b9a\u3055\u308c\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093<\/a><br \/>\n<a href=\"https:\/\/game.g.hatena.ne.jp\/Nao_u\/20181104\">https:\/\/game.g.hatena.ne.jp\/Nao_u\/20181104<\/a><\/p>\n<p>conda install \u3067\u3001\u3084\u308a\u306a\u304a\u3057<\/p>\n<p>&gt;conda install tensorflow-gpu<\/p>\n<p>(\u518d\u8d77\u52d5)<br \/>\n\u78ba\u8a8d\u3002<br \/>\n&gt;python<br \/>\nPython 3.6.7 |Anaconda, Inc.| (default, Oct 28 2018, 19:44:12) [MSC v.1915 64 bit (AMD64)] on win32<br \/>\nType &#8220;help&#8221;, &#8220;copyright&#8221;, &#8220;credits&#8221; or &#8220;license&#8221; for more information.<br \/>\n&gt;&gt;&gt; import tensorflow<br \/>\n&gt;&gt;&gt;<\/p>\n<p>GPU\u306e\u78ba\u8a8d\u3002<\/p>\n<p>&gt;&gt;&gt; from tensorflow.python.client import device_lib<br \/>\n&gt;&gt;&gt; device_lib.list_local_devices()<\/p>\n<p>incarnation: 6008843322704657670<br \/>\n, name: &#8220;\/device:GPU:0&#8221;<br \/>\ndevice_type: &#8220;GPU&#8221;<br \/>\nmemory_limit: 3188244480<br \/>\nlocality {<br \/>\nbus_id: 1<br \/>\nlinks {<br \/>\n}<br \/>\n}<br \/>\nincarnation: 15963565374841221333<br \/>\nphysical_device_desc: &#8220;device: 0, name: GeForce GTX 960, pci bus id: 0000:01:00.0, compute capability: 5.2&#8221;<\/p>\n<p>(5)TFlearn, Keras \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<p>&gt;pip install tflearn<br \/>\n&gt;pip install keras<\/p>\n<p>&gt;&gt;&gt; import tflearn<br \/>\n\u30fb\u30fb\u30fb<br \/>\ncurses is not supported on this machine (please install\/reinstall curses for an optimal experience)<br \/>\n&gt;&gt;&gt;<\/p>\n<p>&gt;&gt;&gt; import keras<br \/>\nUsing TensorFlow backend.<br \/>\n&gt;&gt;&gt;<\/p>\n<p>keras\u306f\u3001\u6210\u529f\u3002TFlearn \u306f\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u8db3\u308a\u306a\u3044\u3088\u3046\u306a\u306e\u3067\u3001<br \/>\n\u3068\u308a\u3042\u3048\u305a\u3001\u6700\u4f4e\u9650\u5fc5\u8981\u306a\u4ee5\u4e0b\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>conda install h5py<br \/>\nconda install scipy<\/p>\n<p>curses\u306f\u3001http:\/\/www.lfd.uci.edu\/~gohlke\/pythonlibs\/#curses<br \/>\n\u304b\u3089\u30d5\u30a1\u30a4\u30ebcurses-2.2-cp36-cp36m-win_amd64.whl\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\npip install curses-2.2-cp36-cp36m-win_amd64.whl<\/p>\n<p>&gt;&gt;&gt;import tflearn<br \/>\n&gt;&gt;&gt;<\/p>\n<p>(6) \u52d5\u4f5c\u78ba\u8a8d<br \/>\n\u5b9f\u884c\u306f\u3001jupyter notebook\u3092\u4f7f\u7528\u3002<\/p>\n<p>Anaconda3\\envs\\tf&gt;\u306b data\/mnist\/\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210<br \/>\nAnaconda3\\envs\\tf&gt;conda activate tf<br \/>\nAnaconda3\\envs\\tf&gt;jupyter notebook<\/p>\n<p><a href=\"https:\/\/www.ecobioinfo.com\/?p=464\">\u300c\u6df1\u5c64\u5b66\u7fd2 TensorFlow \u3092 MNIST \u3067\u8a66\u3059<\/a>\u300d \u306e\u30bd\u30fc\u30b9\u3067\u30c6\u30b9\u30c8\u3002<\/p>\n<p>\u5b9f\u884c\u7d50\u679c<br \/>\n&#8212;<br \/>\nlearning start:2018-11-21 21:05:25.010808<br \/>\nlearning end:2018-11-21 21:08:25.731633<br \/>\npredict start:2018-11-21 21:08:25.731633<br \/>\npredict end:2018-11-21 21:08:25.762890<br \/>\n[7 2 1 &#8230; 4 5 6]<br \/>\n[7 2 1 &#8230; 4 5 6]<br \/>\n0.9797<\/p>\n<p>\u30a8\u30e9\u30fc\u306a\u3057\u3002<\/p>\n<p><a href=\"http:\/\/www.ecobioinfo.com\/?p=582\">\u300c\u6df1\u5c64\u5b66\u7fd2\u3000Keras\uff08TensorFlow\u7528\uff09\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a>\u300d \u306e\u30bd\u30fc\u30b9\u3067\u30c6\u30b9\u30c8\u3002<\/p>\n<p>54000\/54000 [==============================] &#8211; 1s 28us\/step &#8211; loss: 0.2520 &#8211; acc: 0.9284 &#8211; val_loss: 0.1591 &#8211; val_acc: 0.9587<br \/>\n[7 2 1 &#8230; 4 5 6]<br \/>\n[7 2 1 &#8230; 4 5 6]<br \/>\n0.9475<\/p>\n<p>\u30a8\u30e9\u30fc\u306a\u3057\u3002<\/p>\n<p>\u4ee5\u4e0a<\/p>\n<p>\u3010\u53c2\u8003\u6587\u732e\u3011\u3053\u306e\u30d6\u30ed\u30b0\u306e\u53c2\u8003\u66f8\u7c4d\u306f\u3053\u3061\u3089\u306b\u307e\u3068\u3081\u3066\u3042\u308a\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/www.ecobioinfo.com\/?page_id=838\">http:\/\/www.ecobioinfo.com\/?page_id=838<\/a><\/p>\n<p>\uff082018\/11\/21 S.Onda\uff09<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"Tensorflow Winows \u7248\u3067\u3082 GPU\u3092\u5c0e\u5165\u3057\u307e\u3057\u305f\u3002 \uff1c\uff1c\uff1c\u3000\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u3000\uff1e\uff1e\uff1e \u30cf\u30fc\u30c9\uff1a\u30de\u30a6\u30b9\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc LM-iH700B2N CPU\uff1a IntelR Core? i3-8100 CPU @ 3. &#8230;","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-811","post","type-post","status-publish","format-standard","hentry","category-ai_ecobio"],"_links":{"self":[{"href":"https:\/\/www.ecobioinfo.com\/index.php?rest_route=\/wp\/v2\/posts\/811","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ecobioinfo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ecobioinfo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ecobioinfo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ecobioinfo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=811"}],"version-history":[{"count":14,"href":"https:\/\/www.ecobioinfo.com\/index.php?rest_route=\/wp\/v2\/posts\/811\/revisions"}],"predecessor-version":[{"id":1496,"href":"https:\/\/www.ecobioinfo.com\/index.php?rest_route=\/wp\/v2\/posts\/811\/revisions\/1496"}],"wp:attachment":[{"href":"https:\/\/www.ecobioinfo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ecobioinfo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ecobioinfo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}