{"id":326,"date":"2019-10-09T23:38:20","date_gmt":"2019-10-09T15:38:20","guid":{"rendered":"http:\/\/www.mustenaka.cn\/?p=326"},"modified":"2019-10-10T14:42:05","modified_gmt":"2019-10-10T06:42:05","slug":"tensorflowcpuimporterrordllloadfailed","status":"publish","type":"post","link":"https:\/\/www.mustenaka.cn\/index.php\/2019\/10\/09\/tensorflowcpuimporterrordllloadfailed\/","title":{"rendered":"tensorflow CPU\u6307\u4ee4\u96c6\u7f3a\u5931\u5bfc\u81f4\u62a5\u9519\uff1a\u52a8\u6001\u94fe\u63a5\u5e93(DLL)\u521d\u59cb\u5316\u4f8b\u7a0b\u5931\u8d25"},"content":{"rendered":"<p>\u65e0\u8bba\u662ftensorflow\u7684CPU\u7248\u672c\u8fd8\u662fGPU\u7248\u672c\uff0c\u5176\u542f\u52a8\u90fd\u9700\u8981\u7ecf\u8fc7CPU\u7684\u6307\u4ee4\uff0c\u5982\u679c\u6307\u4ee4\u96c6\u7f3a\u5931\u5c31\u4f1a\u62a5\u9519\u3002<\/p>\n<p>\u8fd9\u4e9b\u62a5\u9519\u7684\u539f\u56e0\u5f88\u6709\u53ef\u80fd\u662f\u4f60\u7684CPU\u8fc7\u8001\uff0c\u6216\u8005\u89c4\u683c\u5c5e\u4e8e\u670d\u52a1\u5668\u7ea7\u522b\uff0c\u5982\u65e7\u7248\u672c\u7684\u5fd7\u5f3a\u7cfb\u5217CPU\uff0c\u8fd9\u4e00\u5207\u7684\u539f\u56e0\u90fd\u6709\u53ef\u80fd\u9020\u6210\u00a0<em> ImportError: DLL load failed: \u52a8\u6001\u94fe\u63a5\u5e93(DLL)\u521d\u59cb\u5316\u4f8b\u7a0b\u5931\u8d25\u00a0 \u62a5\u9519\uff0c\u5982\uff1a<\/em><\/p>\n<p><!--more--><\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\" python=\"\">&gt;&gt;&gt; import tensorflow as tf\r\nTraceback (most recent call last):\r\n\u00a0\u00a0File \"I:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\pywrap_tensorflow.py\", line 58, in &lt;module&gt;\r\n\u00a0\u00a0\u00a0\u00a0from tensorflow.python.pywrap_tensorflow_internal import *\r\n\u00a0\u00a0File \"I:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\pywrap_tensorflow_internal.py\", line 28, in &lt;module&gt;\r\n\u00a0\u00a0\u00a0\u00a0_pywrap_tensorflow_internal = swig_import_helper()\r\n\u00a0\u00a0File \"I:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\pywrap_tensorflow_internal.py\", line 24, in swig_import_helper\r\n\u00a0\u00a0\u00a0\u00a0_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)\r\n\u00a0\u00a0File \"I:\\Anaconda3\\lib\\imp.py\", line 242, in load_module\r\n\u00a0\u00a0\u00a0\u00a0return load_dynamic(name, filename, file)\r\n\u00a0\u00a0File \"I:\\Anaconda3\\lib\\imp.py\", line 342, in load_dynamic\r\n\u00a0\u00a0\u00a0\u00a0return _load(spec)\r\nImportError: DLL load failed: \u52a8\u6001\u94fe\u63a5\u5e93(DLL)\u521d\u59cb\u5316\u4f8b\u7a0b\u5931\u8d25\u3002\r\n\u00a0\r\nDuring handling of the above exception, another exception occurred:\r\n\u00a0\r\nTraceback (most recent call last):\r\n\u00a0\u00a0File \"&lt;stdin&gt;\", line 1, in &lt;module&gt;\r\n\u00a0\u00a0File \"I:\\Anaconda3\\lib\\site-packages\\tensorflow\\__init__.py\", line 24, in &lt;module&gt;\r\n\u00a0\u00a0\u00a0\u00a0from tensorflow.python import pywrap_tensorflow \u00a0# pylint: disable=unused-import\r\n\u00a0\u00a0File \"I:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\__init__.py\", line 49, in &lt;module&gt;\r\n\u00a0\u00a0\u00a0\u00a0from tensorflow.python import pywrap_tensorflow\r\n\u00a0\u00a0File \"I:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\pywrap_tensorflow.py\", line 74, in &lt;module&gt;\r\n\u00a0\u00a0\u00a0\u00a0raise ImportError(msg)\r\nImportError: Traceback (most recent call last):\r\n\u00a0\u00a0File \"I:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\pywrap_tensorflow.py\", line 58, in &lt;module&gt;\r\n\u00a0\u00a0\u00a0\u00a0from tensorflow.python.pywrap_tensorflow_internal import *\r\n\u00a0\u00a0File \"I:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\pywrap_tensorflow_internal.py\", line 28, in &lt;module&gt;\r\n\u00a0\u00a0\u00a0\u00a0_pywrap_tensorflow_internal = swig_import_helper()\r\n\u00a0\u00a0File \"I:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\pywrap_tensorflow_internal.py\", line 24, in swig_import_helper\r\n\u00a0\u00a0\u00a0\u00a0_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)\r\n\u00a0\u00a0File \"I:\\Anaconda3\\lib\\imp.py\", line 242, in load_module\r\n\u00a0\u00a0\u00a0\u00a0return load_dynamic(name, filename, file)\r\n\u00a0\u00a0File \"I:\\Anaconda3\\lib\\imp.py\", line 342, in load_dynamic\r\n\u00a0\u00a0\u00a0\u00a0return _load(spec)\r\nImportError: DLL load failed: \u52a8\u6001\u94fe\u63a5\u5e93(DLL)\u521d\u59cb\u5316\u4f8b\u7a0b\u5931\u8d25\u3002\r\n\u00a0\r\n\u00a0\r\nFailed to load the native TensorFlow runtime.\r\n\u00a0\r\nSee https:\/\/www.tensorflow.org\/install\/errors\r\n\u00a0\r\nfor some common reasons and solutions. \u00a0Include the entire stack trace\r\nabove this error message when asking for help.<\/code><\/pre>\n<p>\u8fd9\u6837\u7684\u4e00\u4e2a\u9519\u8bef\u3002<\/p>\n<p>\u4e00\u822c\u6765\u8bf4\uff0ctensorflow\u53ef\u4ee5\u9700\u8981 SSE\/AVX\/FMA \u8fd9\u51e0\u79cd\u6307\u4ee4\u96c6\u7684\u652f\u6301\uff0c\u800c\u9ed8\u8ba4\u4e0b\u8f7d\u7684\u65b9\u5f0f pip install tensorflow-gpu \u8fd9\u6837\u7684\u4e0b\u8f7d\u65b9\u5f0f\uff0c\u6838\u5fc3\u662f\u57fa\u4e8e AVX \u6307\u4ee4\u96c6\uff0c\u8fd9\u4e2a\u6307\u4ee4\u96c6\u4e0d\u4e00\u5b9a\u90fd\u6709\uff08\u5e38\u89c1\u4e8e\u9609\u5272\u7684\u663e\u5361\u7f3a\u5931\u8fd9\u4e2a\u6307\u4ee4\u96c6\uff09\uff0c\u4e5f\u6709\u4e00\u4e9bCPU\u6bd4\u5982\u672c\u4eba\u7684CPU\u5c31\u6ca1\u6709AVX\u6307\u4ee4\u96c6\uff0c\u4f46\u662f\u6709\u4e00\u4e2a\u7c7b\u4f3c\u7684\u6307\u4ee4\u96c6 AES \u5c31\u4f9d\u7136\u53ef\u4ee5\u8fbe\u5230\u6548\u679c\uff0c\u4ed6\u4eec\u7684\u5177\u4f53\u533a\u522b\u5982\u4e0b\uff1a<\/p>\n<blockquote><p>AES\uff1a<span>\u662f\u9ad8\u7ea7<\/span><span>\u52a0\u5bc6\u6807\u51c6\uff0c\u662f\u4e00\u79cd\u52a0\u5bc6\u7b97\u6cd5\u3002\u62e5\u6709<\/span>AES<span>-NI\u6307\u4ee4\u96c6\u7684\u5904\u7406\u5668\u5728\u52a0\u89e3\u5bc6\u65b9\u9762\u4f1a\u6709\u975e\u5e38\u5927\u7684\u6027\u80fd\u98de\u8dc3\u3002<\/span><br \/>\n<span>AVX\uff1a\u662f<\/span>Intel<span>\u6700\u65b0\u63a8\u51fa\u7684\u9ad8\u7ea7\u77e2\u91cf\u6269\u5c55\u6307\u4ee4\u96c6\uff0c\u5c06\u6d6e\u70b9\u6570\u6027\u80fd\u7ffb\u4e86\u4e00\u756a\u2014\u2014\u4ece128Bit\uff0c\u4e0a\u5347\u81f3256Bit\uff0c\u589e\u5f3a\u4e86\u6d6e\u70b9\u6570\u6027\u80fd\u3002<\/span><\/p><\/blockquote>\n<p>\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u66ff\u6362SSE\u7248\u672c\u7684tensorflow\u8fdb\u884c\u5b89\u88c5\uff0cSSE\u6307\u4ee4\u96c6\u7684\u529f\u80fd\u5982\u4e0b\uff0c\u57fa\u672c\u5e02\u9762\u4e0a\u7684CPU\u5747\u652f\u6301\u8fd9\u4e2a\u6307\u4ee4\u96c6\uff0c\u5e94\u7528\u66f4\u52a0\u5e7f\u6cdb\uff1a<\/p>\n<blockquote><p>SSE\u6307\u4ee4\u96c6\u4e5f\u5c31\u662f\u6240\u8c13\u80dc\u51fa\u7684&#8221;\u4e92\u8054\u7f51SSE&#8221;\u6307\u4ee4\u96c6\u3002SSE\u6307\u4ee4\u96c6\u5305\u62ec\u4e8670\u6761\u6307\u4ee4\uff0c\u5176\u4e2d\u5305\u542b\u63d0\u9ad83D\u56fe\u5f62\u8fd0\u7b97\u6548\u7387\u768450\u6761SIMD\uff08\u5355\u6307\u4ee4\u591a\u6570\u636e\u6280\u672f\uff09\u6d6e\u70b9\u8fd0\u7b97\u6307\u4ee4\u300112\u6761MMX \u6574\u6570\u8fd0\u7b97\u589e\u5f3a\u6307\u4ee4\u30018\u6761\u4f18\u5316\u5185\u5b58\u4e2d\u8fde\u7eed\u6570\u636e\u5757\u4f20\u8f93\u6307\u4ee4\u3002\u7406\u8bba\u4e0a\u8fd9\u4e9b\u6307\u4ee4\u5bf9\u76ee\u524d\u6d41\u884c\u7684\u56fe\u50cf\u5904\u7406\u3001\u6d6e\u70b9\u8fd0\u7b97\u30013D\u8fd0\u7b97\u3001\u89c6\u9891\u5904\u7406\u3001\u97f3\u9891\u5904\u7406\u7b49\u8bf8\u591a\u591a\u5a92\u4f53\u5e94\u7528\u8d77\u5230\u5168\u9762\u5f3a\u5316\u7684\u4f5c\u7528\u3002S SE\u6307\u4ee4\u4e0e3DNow!\u6307\u4ee4\u5f7c\u6b64\u4e92\u4e0d\u517c\u5bb9\uff0c\u4f46SSE\u5305\u542b\u4e863DNow!\u6280\u672f\u7684\u7edd\u5927\u90e8\u5206\u529f\u80fd\uff0c\u53ea\u662f\u5b9e\u73b0\u7684\u65b9\u6cd5\u4e0d\u540c\u3002SSE\u517c\u5bb9MMX\u6307\u4ee4\uff0c\u5b83\u53ef\u4ee5\u901a\u8fc7SIMD\u548c\u5355\u65f6\u949f\u5468\u671f\u5e76\u884c\u5904\u7406\u591a\u4e2a\u6d6e\u70b9\u6570\u636e\u6765\u6709\u6548\u5730\u63d0\u9ad8\u6d6e\u70b9\u8fd0\u7b97\u901f\u5ea6\u3002<\/p>\n<p>\u2014\u2014\u2014\u2014\u300a\u767e\u5ea6\u767e\u79d1\u300b<\/p><\/blockquote>\n<p>\u4e0b\u8f7d\u8fde\u63a5\u5982\u4e0b\uff1a<\/p>\n<p><a href=\"https:\/\/github.com\/fo40225\/tensorflow-windows-wheel\">https:\/\/github.com\/fo40225\/tensorflow-windows-wheel<\/a><\/p>\n<p>\u53ef\u4ee5\u5728\u8fd9\u4e2a\u7f51\u5740\u4e0b\u8f7d\u5230\u81ea\u5df1\u9700\u8981\u7684\u6307\u4ee4\u96c6\u7248\u672c\u7684tensorflow\uff0c\u6ce8\u610fCUDA\u548c\u7ec6\u8282\u7248\u672c\u4e0d\u8981\u4e0b\u8f7d\u9519\u8bef\uff0c\u4e3b\u8981\u8fd8\u662f\u652f\u6301python3.7\u7684\u4e3a\u4e3b\u3002<\/p>\n<p>PS:\u8bb0\u5f97\u63d0\u524d\u5220\u9664\u5df2\u7ecf\u5b89\u88c5\u7684\u4e0d\u80fd\u7528\u7684tensorflow<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\" python=\"\">pip uninstall tensorflow\r\npip uninstall tensorflow-gpu\r\n#\u5220\u9664\u5df2\u7ecf\u5b89\u88c5\u7684tensorflow<\/code><\/pre>\n<p>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u653e\u7f6e\u5230\u4e00\u4e2a\u5408\u9002\u7684\u76ee\u5f55\uff08\u4e0d\u4e00\u5b9a\u662f\u9879\u76ee\u6587\u4ef6\u5939\u6216\u8005\u662fpython\u7684\u8def\u5f84\uff09\uff0c\u4e4b\u540e\u5728\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u6253\u5f00cmd\uff0c\u901a\u8fc7pip install\u8fdb\u884c\u5b89\u88c5<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u65e0\u8bba\u662ftensorflow\u7684CPU\u7248\u672c\u8fd8\u662fGPU\u7248\u672c\uff0c\u5176\u542f\u52a8\u90fd\u9700\u8981\u7ecf\u8fc7CPU\u7684\u6307\u4ee4\uff0c\u5982\u679c\u6307\u4ee4\u96c6\u7f3a\u5931\u5c31 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[31,42],"class_list":["post-326","post","type-post","status-publish","format-standard","hentry","category-python","tag-python","tag-tensorflow"],"views":6208,"_links":{"self":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts\/326","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=326"}],"version-history":[{"count":3,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts\/326\/revisions"}],"predecessor-version":[{"id":331,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts\/326\/revisions\/331"}],"wp:attachment":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/media?parent=326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/categories?post=326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/tags?post=326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}