{"id":897,"date":"2021-02-15T01:08:51","date_gmt":"2021-02-14T17:08:51","guid":{"rendered":"http:\/\/www.mustenaka.cn\/?p=897"},"modified":"2021-02-15T18:30:39","modified_gmt":"2021-02-15T10:30:39","slug":"howtoinstallcudnn","status":"publish","type":"post","link":"https:\/\/www.mustenaka.cn\/index.php\/2021\/02\/15\/howtoinstallcudnn\/","title":{"rendered":"\u5982\u4f55\u5728Windows\u4e0a\u5b89\u88c5cuDNN"},"content":{"rendered":"<h3>Windows\u4e0b\u5982\u4f55\u5b89\u88c5cuDNN<!--more--><\/h3>\n<blockquote><p>\u6211\u5728\u5b89\u88c5\u4e86CUDA\u4e4b\u540e\uff0c\u53d1\u73b0cuDNN\u5fd8\u8bb0\u5b89\u88c5\u4e86\uff0ctensorflow\u4e00\u5b9a\u8981\u5b89\u88c5\u8fd9\u4e2a\u624d\u884c\uff0c\u7531\u4e8e\u7535\u8111\u6709\u70b9\u8001\u4e86,CUDA\u4e5f\u4e0d\u662f\u6700\u65b0\u768411\uff0ctensorflow\u8fd8\u505c\u7559\u57281.XX\u65f6\u4ee3\u3002<\/p><\/blockquote>\n<p>\u9996\u5148\u73b0\u5728\u8fd9\u4e2a\u5730\u5740\u4e0a\u9762\u4e0b\u8f7dcuDNN\uff0c\u6ce8\u610f\u5bf9\u5e94\u81ea\u5df1\u7684CUDA\u7248\u672c\u624d\u884c\uff0c\u9700\u8981\u767b\u9646\u82f1\u4f1f\u8fbe\u8d26\u53f7\u8fdb\u884c\u4e0b\u8f7d\uff0c\u672c\u4eba\u4e0b\u8f7d\u4e86\u51e0\u4e2a\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\uff0c\u4f20\u5230\u4e86\u535a\u5ba2\u7684\u4e0b\u8f7d\u76ee\u5f55\u91cc\u9762\u3002<\/p>\n<p><a href=\"https:\/\/developer.nvidia.com\/rdp\/cudnn-archive\">https:\/\/developer.nvidia.com\/rdp\/cudnn-archive<\/a><\/p>\n<p>\u89e3\u538b\u5b8c\u6210\u540e\u4e3b\u8981\u6709\u4e09\u4e2a\u76ee\u5f55bin\/\u00a0 \u00a0include\/\u00a0 lib\/x64\/\u628a\u4ed6\u4eec\u5176\u4e2d\u7684\u5185\u5bb9\u5206\u522b\u4e22\u5230C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.1\u7684\u4e09\u4e2a\u540c\u540d\u5206\u7ea7\u76ee\u5f55\u4e0b\uff08\u4ee5\u4e2a\u4eba\u5b9e\u9645\u7684CUDA\u5b89\u88c5\u76ee\u5f55\u4e3a\u51c6\uff09<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/www.mustenaka.cn\/wp-content\/uploads\/2021\/02\/0DN1ZGFYCS4KOX2JDQ7.png\" alt=\"\" width=\"1037\" height=\"250\" class=\"alignnone size-full wp-image-899\" srcset=\"https:\/\/www.mustenaka.cn\/wp-content\/uploads\/2021\/02\/0DN1ZGFYCS4KOX2JDQ7.png 1037w, https:\/\/www.mustenaka.cn\/wp-content\/uploads\/2021\/02\/0DN1ZGFYCS4KOX2JDQ7-300x72.png 300w, https:\/\/www.mustenaka.cn\/wp-content\/uploads\/2021\/02\/0DN1ZGFYCS4KOX2JDQ7-1024x247.png 1024w, https:\/\/www.mustenaka.cn\/wp-content\/uploads\/2021\/02\/0DN1ZGFYCS4KOX2JDQ7-768x185.png 768w\" sizes=\"(max-width: 1037px) 100vw, 1037px\" \/><\/p>\n<p>\u4e4b\u540e\u5c31\u53ef\u4ee5\u62fftensorflow\u8bd5\u7740\u5199\u4e00\u4e2ahello world\u4e86<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\" python=\"\">import tensorflow as tf\r\nhello = tf.constant('Hello, TensorFlow!')\r\nsess = tf.Session()\r\nprint(sess.run(hello))<\/code> # output <span>Hello<\/span><span class=\"token punctuation\">,<\/span><span> TensorFlow! <\/span><\/pre>\n<p>\u4e5f\u53ef\u4ee5\u7528tensorflow\u770b\u770b\u662f\u5426\u53ef\u4ee5\u7528GPU<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\" python=\"\">import tensorflow as tf\r\n\r\ngpu_device_name = tf.test.gpu_device_name()\r\nprint(gpu_device_name)<\/code><\/pre>\n<blockquote><p>\u4f1a\u751f\u6210\u4e2d\u95f4\u4fe1\u606f<\/p>\n<div><span>2021-02-15 00:58:03.346933: I tensorflow\/stream_executor\/platform\/default\/dso_loader.cc:42] Successfully opened dynamic<br \/>\nlibrary nvcuda.dll<br \/>\n2021-02-15 00:58:03.373643: I tensorflow\/core\/common_runtime\/gpu\/gpu_device.cc:1640] Found device 0 with properties:<br \/>\nname: GeForce GTX 960M major: 5 minor: 0 memoryClockRate(GHz): 1.176<br \/>\npciBusID: 0000:01:00.0<br \/>\n2021-02-15 00:58:03.373887: I tensorflow\/stream_executor\/platform\/default\/dlopen_checker_stub.cc:25] GPU libraries are s<br \/>\ntatically linked, skip dlopen check.<br \/>\n2021-02-15 00:58:03.374227: I tensorflow\/core\/common_runtime\/gpu\/gpu_device.cc:1763] Adding visible gpu devices: 0<br \/>\n2021-02-15 01:01:08.960541: I tensorflow\/core\/common_runtime\/gpu\/gpu_device.cc:1181] Device interconnect StreamExecutor<br \/>\nwith strength 1 edge matrix:<br \/>\n2021-02-15 01:01:08.960772: I tensorflow\/core\/common_runtime\/gpu\/gpu_device.cc:1187] 0<br \/>\n2021-02-15 01:01:08.961241: I tensorflow\/core\/common_runtime\/gpu\/gpu_device.cc:1200] 0: N<br \/>\n2021-02-15 01:01:08.964950: I tensorflow\/core\/common_runtime\/gpu\/gpu_device.cc:1326] Created TensorFlow device (\/device:<br \/>\nGPU:0 with 3048 MB memory) -&gt; physical GPU (device: 0, name: GeForce GTX 960M, pci bus id: 0000:01:00.0, compute capabil<br \/>\nity: 5.0)<\/span><\/div>\n<\/blockquote>\n<p>\u7136\u540e\u8f93\u51fa<\/p>\n<p><!--StartFragment --><\/p>\n<blockquote>\n<div><span>\/device:GPU:0<\/span><\/div>\n<\/blockquote>\n<p><!--EndFragment --><\/p>\n<p>\u6216\u8005\u4f7f\u7528 <!--StartFragment --><span>tf.test.is_gpu_available() \u5224\u65adgpu\u662f\u5426\u53ef\u7528<\/span><\/p>\n<p>\u8fd4\u56de<\/p>\n<p><!--StartFragment --><\/p>\n<blockquote>\n<div><span>True<\/span><\/div>\n<\/blockquote>\n<p><!--EndFragment --><\/p>\n<p><!--EndFragment --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows\u4e0b\u5982\u4f55\u5b89\u88c5cuDNN<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,1,30,41],"tags":[12,31,42],"class_list":["post-897","post","type-post","status-publish","format-standard","hentry","category-ai","category-helloworld","category-python","category-tensorflow","tag-ai","tag-python","tag-tensorflow"],"views":1607,"_links":{"self":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts\/897","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/comments?post=897"}],"version-history":[{"count":5,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts\/897\/revisions"}],"predecessor-version":[{"id":900,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts\/897\/revisions\/900"}],"wp:attachment":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/media?parent=897"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/categories?post=897"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/tags?post=897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}