{"id":227366,"date":"2024-05-11T20:46:55","date_gmt":"2024-05-11T12:46:55","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/227366.html"},"modified":"2024-05-11T20:47:03","modified_gmt":"2024-05-11T12:47:03","slug":"%e4%b8%ba%e4%bb%80%e4%b9%88tensorflow2-3%e5%92%8c1-3%e8%b7%91%e5%90%8c%e6%a0%b7%e7%9a%84%e4%bb%a3%e7%a0%81%ef%bc%8c%e6%95%88%e6%9e%9c%e5%b7%ae%e5%be%88%e5%a4%9a","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/227366.html","title":{"rendered":"\u4e3a\u4ec0\u4e48TensorFlow2.3\u548c1.3\u8dd1\u540c\u6837\u7684\u4ee3\u7801\uff0c\u6548\u679c\u5dee\u5f88\u591a"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25150546\/3cf55c9e-f70a-44d8-8cf2-101d228badd4.webp\" alt=\"\u4e3a\u4ec0\u4e48TensorFlow2.3\u548c1.3\u8dd1\u540c\u6837\u7684\u4ee3\u7801\uff0c\u6548\u679c\u5dee\u5f88\u591a\" \/><\/p>\n<p><p><strong>TensorFlow 2.3\u548c1.3\u8fd0\u884c\u76f8\u540c\u4ee3\u7801\u6548\u679c\u5b58\u5728\u663e\u8457\u5dee\u5f02\u7684\u539f\u56e0\u4e3b\u8981\u6709\uff1a\u5e95\u5c42\u67b6\u6784\u7684\u66f4\u65b0\u3001\u9ed8\u8ba4\u7684Eager Execution\u6a21\u5f0f\u3001API\u7684\u53d8\u5316\u3001\u4ee5\u53ca\u6027\u80fd\u4f18\u5316\u548c\u81ea\u52a8\u56fe\u4f18\u5316\u673a\u5236\u7684\u52a0\u5f3a\u3002<\/strong> \u7279\u522b\u5730\uff0c\u5e95\u5c42\u67b6\u6784\u7684\u66f4\u65b0\u5e26\u6765\u4e86\u5bf9\u786c\u4ef6\u652f\u6301\u7684\u6539\u8fdb\u3001\u8ba1\u7b97\u6548\u7387\u7684\u63d0\u5347\u4ee5\u53ca\u66f4\u5e7f\u6cdb\u7684\u5e73\u53f0\u517c\u5bb9\u6027\uff0c\u8fd9\u4e9b\u90fd\u53ef\u80fd\u5bfc\u81f4\u5728\u4e0d\u540c\u7248\u672c\u4e0a\u8fd0\u884c\u76f8\u540c\u4ee3\u7801\u65f6\u8868\u73b0\u51fa\u4e0d\u540c\u7684\u6548\u679c\u3002<\/p>\n<\/p>\n<p><p>\u5e95\u5c42\u67b6\u6784\u7684\u66f4\u65b0\u610f\u5473\u7740TensorFlow\u56e2\u961f\u5728\u7248\u672c\u8fed\u4ee3\u4e2d\u5bf9\u6838\u5fc3\u4ee3\u7801\u505a\u4e86\u4f18\u5316\u548c\u91cd\u6784\uff0c\u8fdb\u4e00\u6b65\u63d0\u9ad8\u4e86\u6846\u67b6\u7684\u6267\u884c\u6548\u7387\u548c<a href=\"https:\/\/docs.pingcode.com\/blog\/project-management\/58557.html\" target=\"_blank\">\u8d44\u6e90\u7ba1\u7406<\/a>\u6548\u80fd\u3002\u6bd4\u5982\uff0cTensorFlow 2.x\u7248\u672c\u5f15\u5165\u4e86\u591a\u9879\u65b0\u7684\u56fe\u4f18\u5316\u6280\u672f\uff0c\u5982\u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3\uff08AMP\uff09\u3001XLA\uff08\u52a0\u901f\u7ebf\u6027\u4ee3\u6570\uff09\u7f16\u8bd1\u5668\u7b49\uff0c\u8fd9\u4e9b\u6280\u672f\u53ef\u4ee5\u5927\u5e45\u63d0\u5347\u6a21\u578b\u8bad\u7ec3\u548c\u63a8\u7406\u65f6\u7684\u6027\u80fd\uff0c\u51cf\u5c11\u5185\u5b58\u6d88\u8017\uff0c\u52a0\u901f\u6a21\u578b\u7684\u6267\u884c\u901f\u5ea6\u3002<\/p>\n<\/p>\n<p><h2>\u4e00\u3001\u5e95\u5c42\u67b6\u6784\u7684\u66f4\u65b0<\/h2>\n<\/p>\n<p><p>TensorFlow 2.x\u8fdb\u884c\u4e86\u5927\u89c4\u6a21\u7684\u67b6\u6784\u66f4\u65b0\uff0c\u6539\u8fdb\u4e86\u5bf9\u591a\u79cd\u786c\u4ef6\u7684\u652f\u6301\u548c\u8ba1\u7b97\u56fe\u7684\u6267\u884c\u6548\u7387\u3002\u5728\u67b6\u6784\u4e0a\uff0c2.x\u7248\u672c\u76f8\u8f83\u4e8e1.x\u8fdb\u884c\u4e86\u8bf8\u591a\u7684\u6539\u8fdb\uff0c\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\u5bf9CUDA\u548ccuDNN\u7684\u66f4\u6df1\u5c42\u6b21\u96c6\u6210\u3001\u66f4\u597d\u7684CPU\u591a\u7ebf\u7a0b\u652f\u6301\u3001\u4ee5\u53ca\u5bf9\u65b0\u786c\u4ef6\uff08\u5982TPU\uff09\u7684\u4f18\u5316\u652f\u6301\u3002\u8fd9\u4e9b\u6539\u8fdb\u610f\u5473\u7740\u5373\u4f7f\u662f\u76f8\u540c\u7684\u7b97\u6cd5\uff0c\u57fa\u4e8e2.x\u7248\u672c\u7684\u5b9e\u73b0\u4e5f\u53ef\u80fd\u4f1a\u6bd41.x\u7248\u672c\u5728\u8ba1\u7b97\u6548\u7387\u3001\u8d44\u6e90\u6d88\u8017\u548c\u6267\u884c\u901f\u5ea6\u4e0a\u6709\u660e\u663e\u7684\u63d0\u5347\u3002<\/p>\n<\/p>\n<p><h2>\u4e8c\u3001\u9ed8\u8ba4\u7684Eager Execution\u6a21\u5f0f<\/h2>\n<\/p>\n<p><p>\u76f8\u5bf91.x\u7684\u9759\u6001\u56fe\uff0cTensorFlow 2.x\u9ed8\u8ba4\u542f\u7528\u4e86Eager Execution\u7684\u52a8\u6001\u56fe\u6a21\u5f0f\uff0c\u8fd9\u4f7f\u5f97\u5f00\u53d1\u66f4\u52a0\u76f4\u89c2\u548c\u7528\u6237\u53cb\u597d\uff0c\u4f46\u4e5f\u53ef\u80fd\u5f71\u54cd\u6027\u80fd\u3002Eager Execution\u6a21\u5f0f\u5141\u8bb8\u64cd\u4f5c\u7acb\u5373\u6267\u884c\u5e76\u8fd4\u56de\u7ed3\u679c\uff0c\u8ba9\u5f00\u53d1\u8005\u80fd\u591f\u66f4\u8f7b\u677e\u5730\u8fdb\u884c\u8c03\u8bd5\u548c\u52a8\u6001\u56fe\u7684\u6784\u5efa\u3002\u867d\u7136\u52a8\u6001\u56fe\u63d0\u4f9b\u4e86\u66f4\u9ad8\u7684\u7075\u6d3b\u6027\uff0c\u4f46\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u5b83\u53ef\u80fd\u4e0d\u5982\u9759\u6001\u56fe\u5728\u6267\u884c\u6548\u7387\u548c\u8d44\u6e90\u7ba1\u7406\u4e0a\u9ad8\u6548\u3002\u4e3a\u6b64\uff0cTensorFlow 2.x\u63d0\u4f9b\u4e86tf.function\u88c5\u9970\u5668\uff0c\u5c06\u52a8\u6001\u56fe\u4ee3\u7801\u8f6c\u6362\u4e3a\u9759\u6001\u56fe\uff0c\u4ee5\u6b64\u6765\u5e73\u8861\u5f00\u53d1\u7684\u7075\u6d3b\u6027\u548c\u6267\u884c\u6548\u7387\u3002<\/p>\n<\/p>\n<p><h2>\u4e09\u3001API\u7684\u53d8\u5316<\/h2>\n<\/p>\n<p><p>\u4ece1.x\u5347\u7ea7\u52302.x\uff0cTensorFlow\u5bf9API\u8fdb\u884c\u4e86\u5927\u91cf\u7684\u66f4\u65b0\u548c\u7b80\u5316\uff0c\u65e8\u5728\u63d0\u5347\u5f00\u53d1\u6548\u7387\u548c\u4ee3\u7801\u7684\u6613\u8bfb\u6027\u3002\u867d\u7136\u5927\u591a\u6570\u57fa\u7840API\u4fdd\u6301\u4e86\u5411\u524d\u517c\u5bb9\uff0c\u4f46\u8bb8\u591a\u65e7\u7248API\u88ab\u6807\u8bb0\u4e3a\u5e9f\u5f03\uff0c\u5e76\u63a8\u51fa\u4e86\u65b0\u7684\u3001\u66f4\u7b80\u6d01\u7684API\u6765\u66ff\u4ee3\u3002\u8fd9\u4e9b\u6539\u53d8\u53ef\u80fd\u4f1a\u5f71\u54cd\u5230\u539f\u6709\u4ee3\u7801\u7684\u884c\u4e3a\u548c\u6027\u80fd\u8868\u73b0\u3002\u4f8b\u5982\uff0c2.x\u7248\u672c\u4e2d\u5bf9\u6570\u636e\u7ba1\u9053\u7684\u5904\u7406\uff08\u5982tf.data\uff09\u8fdb\u884c\u4e86\u4f18\u5316\uff0c\u65e8\u5728\u63d0\u9ad8\u6570\u636e\u52a0\u8f7d\u548c\u9884\u5904\u7406\u7684\u6548\u7387\uff0c\u4f46\u8fd9\u5c31\u8981\u6c42\u5f00\u53d1\u8005\u6309\u7167\u65b0\u7684API\u4f7f\u7528\u6307\u5357\u6765\u91cd\u6784\u65e7\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h2>\u56db\u3001\u6027\u80fd\u4f18\u5316\u548c\u81ea\u52a8\u56fe\u4f18\u5316\u673a\u5236\u7684\u52a0\u5f3a<\/h2>\n<\/p>\n<p><p>TensorFlow 2.x\u5728\u6027\u80fd\u4f18\u5316\u65b9\u9762\u5f15\u5165\u4e86\u591a\u9879\u65b0\u6280\u672f\uff0c\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3\u3001XLA\u7f16\u8bd1\u4f18\u5316\u4ee5\u53ca\u5bf9\u56fe\u6267\u884c\u7684\u4f18\u5316\u3002\u8fd9\u4e9b\u6280\u672f\u65e8\u5728\u51cf\u5c11\u6a21\u578b\u8bad\u7ec3\u548c\u63a8\u65ad\u65f6\u7684\u5ef6\u8fdf\uff0c\u964d\u4f4e\u5185\u5b58\u6d88\u8017\uff0c\u5e76\u63d0\u9ad8\u6574\u4f53\u8fd0\u884c\u6548\u7387\u3002\u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3\u5229\u7528\u4e86\u73b0\u4ee3GPU\u80fd\u591f\u5728\u4f4e\u7cbe\u5ea6\u4e0b\u66f4\u9ad8\u6548\u5730\u8fdb\u884c\u8ba1\u7b97\u7684\u7279\u70b9\uff0c\u4ece\u800c\u52a0\u901f\u4e86\u6a21\u578b\u8bad\u7ec3\u8fc7\u7a0b\u3002XLA\u7f16\u8bd1\u5668\u80fd\u591f\u4f18\u5316TensorFlow\u56fe\u7684\u6267\u884c\uff0c\u901a\u8fc7\u878d\u5408\u64cd\u4f5c\u7b49\u6280\u672f\u51cf\u5c11\u8ba1\u7b97\u8282\u70b9\uff0c\u964d\u4f4e\u6267\u884c\u56fe\u65f6\u7684\u5f00\u9500\u3002<\/p>\n<\/p>\n<p><p>\u603b\u7ed3\u6765\u8bf4\uff0c\u5728TensorFlow 2.3\u548c1.3\u7248\u672c\u4e4b\u95f4\u8fd0\u884c\u540c\u6837\u7684\u4ee3\u7801\u8868\u73b0\u51fa\u663e\u8457\u7684\u6027\u80fd\u5dee\u5f02\uff0c\u5e76\u4e0d\u4ee4\u4eba\u610f\u5916\u3002\u5347\u7ea7\u5230TensorFlow 2.x\u7248\u672c\uff0c\u5e26\u6765\u4e86\u5e95\u5c42\u67b6\u6784\u7684\u66f4\u65b0\u3001\u7f16\u7a0b\u6a21\u5f0f\u7684\u8f6c\u53d8\u3001API\u7684\u53d8\u9769\u4ee5\u53ca\u6027\u80fd\u4f18\u5316\u7684\u6539\u8fdb\uff0c\u6240\u6709\u8fd9\u4e9b\u56e0\u7d20\u90fd\u53ef\u80fd\u5f71\u54cd\u5230\u4ee3\u7801\u7684\u6267\u884c\u6548\u679c\u548c\u6027\u80fd\u8868\u73b0\u3002\u56e0\u6b64\uff0c\u5f53\u8fc1\u79fb\u65e7\u4ee3\u7801\u81f3\u65b0\u7248\u672c\u65f6\uff0c\u5f00\u53d1\u8005\u53ef\u80fd\u9700\u8981\u8003\u8651\u8fd9\u4e9b\u53d8\u5316\uff0c\u5e76\u76f8\u5e94\u5730\u8c03\u6574\u548c\u4f18\u5316\u4ee3\u7801\uff0c\u4ee5\u5145\u5206\u5229\u7528TensorFlow 2.x\u5e26\u6765\u7684\u65b0\u7279\u6027\u548c\u6027\u80fd\u6539\u8fdb\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>\u4e3a\u4ec0\u4e48\u5728TensorFlow 2.3\u548c1.3\u7248\u672c\u4e2d\u8fd0\u884c\u76f8\u540c\u7684\u4ee3\u7801\u65f6\u4f1a\u51fa\u73b0\u4e0d\u540c\u7684\u6548\u679c\uff1f<\/strong><\/p>\n<p>\u5728TensorFlow 2.3\u548c1.3\u7248\u672c\u4e4b\u95f4\uff0c\u5b58\u5728\u4e00\u4e9b\u91cd\u8981\u7684\u53d8\u5316\u548c\u66f4\u65b0\uff0c\u8fd9\u53ef\u80fd\u5bfc\u81f4\u76f8\u540c\u7684\u4ee3\u7801\u5728\u4e24\u4e2a\u7248\u672c\u4e4b\u95f4\u5177\u6709\u4e0d\u540c\u7684\u6548\u679c\u3002<\/p>\n<ol>\n<li>\n<p><strong>API\u7684\u6539\u53d8\uff1a<\/strong> TensorFlow 2.3\u5f15\u5165\u4e86\u8bb8\u591a\u65b0\u7279\u6027\u548c\u6539\u8fdb\uff0c\u5305\u62ec\u5bf9Keras API\u7684\u96c6\u6210\u3001Eager Execution\u7684\u9ed8\u8ba4\u542f\u7528\u4ee5\u53ca\u66f4\u597d\u7684\u6027\u80fd\u4f18\u5316\u7b49\u3002\u8fd9\u4e9b\u53d8\u5316\u53ef\u80fd\u5bfc\u81f4\u76f8\u540c\u7684\u4ee3\u7801\u57282.3\u7248\u672c\u4e2d\u8fd0\u884c\u65f6\u4ea7\u751f\u66f4\u597d\u7684\u6548\u679c\uff0c\u800c\u57281.3\u7248\u672c\u4e2d\u5219\u8868\u73b0\u8f83\u5dee\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u4f18\u5316\u7b97\u6cd5\u7684\u6539\u8fdb\uff1a<\/strong> TensorFlow\u7684\u66f4\u65b0\u7248\u672c\u901a\u5e38\u4f1a\u63d0\u4f9b\u66f4\u9ad8\u6548\u7684\u4f18\u5316\u7b97\u6cd5\uff0c\u4ee5\u8fdb\u4e00\u6b65\u63d0\u5347\u8bad\u7ec3\u548c\u63a8\u7406\u7684\u6027\u80fd\u3002\u8fd9\u4e9b\u7b97\u6cd5\u7684\u6539\u8fdb\u53ef\u4ee5\u5bfc\u81f4\u76f8\u540c\u7684\u4ee3\u7801\u57282.3\u7248\u672c\u4e2d\u8fd0\u884c\u65f6\u83b7\u5f97\u66f4\u597d\u7684\u7ed3\u679c\u3002<\/p>\n<\/li>\n<li>\n<p><strong>bug\u4fee\u590d\u548c\u9519\u8bef\u5904\u7406\uff1a<\/strong> TensorFlow\u7684\u4e0d\u540c\u7248\u672c\u4e2d\u90fd\u4f1a\u5bf9\u5148\u524d\u7248\u672c\u4e2d\u7684\u9519\u8bef\u8fdb\u884c\u4fee\u590d\u548c\u6539\u8fdb\u3002\u56e0\u6b64\uff0c\u76f8\u540c\u7684\u4ee3\u7801\u57282.3\u7248\u672c\u4e2d\u53ef\u80fd\u4f1a\u66f4\u597d\u5730\u5904\u7406\u9519\u8bef\u60c5\u51b5\uff0c\u5e76\u4ea7\u751f\u66f4\u51c6\u786e\u7684\u7ed3\u679c\u3002<\/p>\n<\/li>\n<\/ol>\n<p>\u603b\u800c\u8a00\u4e4b\uff0cTensorFlow\u7684\u7248\u672c\u4e4b\u95f4\u5b58\u5728\u8bb8\u591a\u53d8\u5316\u548c\u6539\u8fdb\uff0c\u8fd9\u4e9b\u5bf9\u4ee3\u7801\u7684\u5f71\u54cd\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5728\u4e0d\u540c\u7248\u672c\u4e2d\u8fd0\u884c\u76f8\u540c\u4ee3\u7801\u65f6\u51fa\u73b0\u5dee\u5f02\u7684\u60c5\u51b5\u3002\u5982\u679c\u60a8\u53d1\u73b0\u76f8\u540c\u7684\u4ee3\u7801\u5728\u4e24\u4e2a\u7248\u672c\u4e2d\u7684\u6548\u679c\u5dee\u5f02\u5f88\u5927\uff0c\u5efa\u8bae\u60a8\u8003\u8651\u68c0\u67e5\u4ee3\u7801\u3001\u8c03\u6574\u53c2\u6570\u6216\u5347\u7ea7\u5230\u6700\u65b0\u7248\u672c\uff0c\u4ee5\u83b7\u5f97\u66f4\u597d\u7684\u7ed3\u679c\u3002<\/p>\n<p><strong>\u6211\u8be5\u5982\u4f55\u5728TensorFlow\u4e2d\u5b9e\u73b0\u6a21\u578b\u7684\u53ef\u89e3\u91ca\u6027\uff1f<\/strong><\/p>\n<p>\u8981\u5728TensorFlow\u4e2d\u5b9e\u73b0\u6a21\u578b\u7684\u53ef\u89e3\u91ca\u6027\uff0c\u53ef\u4ee5\u8003\u8651\u4ee5\u4e0b\u65b9\u6cd5\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528\u53ef\u89e3\u91ca\u7684\u6a21\u578b\uff1a<\/strong> \u9009\u62e9\u80fd\u591f\u63d0\u4f9b\u66f4\u597d\u89e3\u91ca\u6027\u7684\u6a21\u578b\uff0c\u4f8b\u5982\u51b3\u7b56\u6811\u3001\u7ebf\u6027\u56de\u5f52\u7b49\u3002\u8fd9\u4e9b\u6a21\u578b\u53ef\u4ee5\u66f4\u76f4\u89c2\u5730\u89e3\u91ca\u6bcf\u4e2a\u7279\u5f81\u5bf9\u7ed3\u679c\u7684\u5f71\u54cd\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u7279\u5f81\u91cd\u8981\u6027\u5206\u6790\uff1a<\/strong> \u53ef\u4ee5\u4f7f\u7528\u7279\u5f81\u91cd\u8981\u6027\u5206\u6790\u6765\u8861\u91cf\u6bcf\u4e2a\u7279\u5f81\u5bf9\u6a21\u578b\u7ed3\u679c\u7684\u8d21\u732e\u7a0b\u5ea6\u3002\u4e00\u79cd\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528\u968f\u673a\u68ee\u6797\u6216\u68af\u5ea6\u63d0\u5347\u6811\u6a21\u578b\uff0c\u5e76\u68c0\u67e5\u7279\u5f81\u7684\u91cd\u8981\u6027\u5f97\u5206\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u53ef\u89c6\u5316\uff1a<\/strong> \u5229\u7528\u53ef\u89c6\u5316\u5de5\u5177\uff0c\u5982TensorBoard\uff0c\u5c06\u6a21\u578b\u7684\u7ed3\u6784\u548c\u8bad\u7ec3\u8fc7\u7a0b\u53ef\u89c6\u5316\u3002\u8fd9\u6709\u52a9\u4e8e\u7406\u89e3\u6a21\u578b\u7684\u5185\u90e8\u5de5\u4f5c\u539f\u7406\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u5c40\u90e8\u89e3\u91ca\u6027\uff1a<\/strong> \u8003\u8651\u4f7f\u7528\u5c40\u90e8\u89e3\u91ca\u6027\u65b9\u6cd5\uff0c\u5982LIME\uff08\u5c40\u90e8\u9010\u6b65\u7ebf\u6027\u4e92\u6362\uff09\u6216SHAP\uff08Shapley Additive Explanations\uff09\u6765\u89e3\u91ca\u5355\u4e2a\u6837\u672c\u6216\u7279\u5b9a\u9884\u6d4b\u7684\u7ed3\u679c\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u8f93\u5165\u91cd\u8981\u6027\u5206\u6790\uff1a<\/strong> \u901a\u8fc7\u5206\u6790\u6a21\u578b\u5bf9\u8f93\u5165\u6570\u636e\u4e2d\u4e0d\u540c\u7279\u5f81\u7684\u654f\u611f\u6027\u6765\u4e86\u89e3\u6a21\u578b\u662f\u5982\u4f55\u505a\u51fa\u9884\u6d4b\u7684\u3002\u53ef\u4ee5\u4f7f\u7528\u68af\u5ea6\u3001\u68af\u5ea6x\u8f93\u5165\u6216LRP\uff08layer-wise relevance propagation\uff09\u7b49\u65b9\u6cd5\u6765\u8ba1\u7b97\u8f93\u5165\u7684\u91cd\u8981\u6027\u5206\u6570\u3002<\/p>\n<\/li>\n<\/ol>\n<p>\u901a\u8fc7\u7efc\u5408\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u5728TensorFlow\u4e2d\u5b9e\u73b0\u6a21\u578b\u7684\u53ef\u89e3\u91ca\u6027\uff0c\u5e76\u66f4\u597d\u5730\u7406\u89e3\u6a21\u578b\u7684\u5de5\u4f5c\u539f\u7406\u548c\u9884\u6d4b\u7ed3\u679c\u3002<\/p>\n<p><strong>\u5982\u4f55\u4f18\u5316TensorFlow\u6a21\u578b\u7684\u8bad\u7ec3\u901f\u5ea6\uff1f<\/strong><\/p>\n<p>\u8981\u4f18\u5316TensorFlow\u6a21\u578b\u7684\u8bad\u7ec3\u901f\u5ea6\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4ee5\u4e0b\u65b9\u6cd5\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u6570\u636e\u9884\u5904\u7406\uff1a<\/strong> \u5bf9\u8f93\u5165\u6570\u636e\u8fdb\u884c\u9884\u5904\u7406\uff0c\u4f8b\u5982\u5f52\u4e00\u5316\u3001\u6807\u51c6\u5316\u6216\u7f29\u653e\u7b49\uff0c\u4ee5\u51cf\u5c11\u6a21\u578b\u7684\u8ba1\u7b97\u590d\u6742\u6027\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528GPU\u52a0\u901f\uff1a<\/strong> \u5982\u679c\u60a8\u7684\u8ba1\u7b97\u673a\u5177\u6709GPU\uff08\u56fe\u5f62\u5904\u7406\u5355\u5143\uff09\uff0c\u53ef\u4ee5\u4f7f\u7528TensorFlow\u7684GPU\u652f\u6301\u6765\u52a0\u901f\u6a21\u578b\u7684\u8bad\u7ec3\u3002\u901a\u8fc7\u4f7f\u7528GPU\u8fdb\u884c\u5e76\u884c\u8ba1\u7b97\uff0c\u53ef\u4ee5\u5927\u5e45\u63d0\u9ad8\u8bad\u7ec3\u901f\u5ea6\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u6279\u91cf\u8bad\u7ec3\uff1a<\/strong> \u4f7f\u7528\u6279\u91cf\u8bad\u7ec3\uff08minibatch tr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>ning\uff09\u4ee3\u66ff\u9010\u4e2a\u6837\u672c\u8bad\u7ec3\uff0c\u53ef\u4ee5\u663e\u8457\u51cf\u5c11\u8ba1\u7b97\u91cf\uff0c\u63d0\u9ad8\u8bad\u7ec3\u901f\u5ea6\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u8c03\u6574\u6a21\u578b\u7ed3\u6784\uff1a<\/strong> \u8003\u8651\u51cf\u5c0f\u6a21\u578b\u7684\u89c4\u6a21\uff0c\u4f8b\u5982\u51cf\u5c11\u9690\u85cf\u5c42\u7684\u6570\u91cf\u3001\u51cf\u5c11\u795e\u7ecf\u5143\u7684\u6570\u91cf\u6216\u9009\u62e9\u66f4\u7b80\u5355\u7684\u6a21\u578b\u7ed3\u6784\u3002\u8fd9\u6837\u53ef\u4ee5\u51cf\u5c11\u53c2\u6570\u7684\u6570\u91cf\uff0c\u964d\u4f4e\u6a21\u578b\u7684\u8ba1\u7b97\u590d\u6742\u5ea6\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528TensorFlow\u7684\u4f18\u5316\u5668\uff1a<\/strong> TensorFlow\u63d0\u4f9b\u4e86\u591a\u79cd\u4f18\u5316\u5668\uff0c\u5982Adam\u3001Stochastic Gradient Descent\u7b49\u3002\u5c1d\u8bd5\u4e0d\u540c\u7684\u4f18\u5316\u5668\uff0c\u5e76\u8c03\u6574\u5176\u53c2\u6570\uff0c\u4ee5\u627e\u5230\u6700\u4f73\u7684\u8bad\u7ec3\u901f\u5ea6\u548c\u6536\u655b\u6548\u679c\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u786c\u4ef6\u4f18\u5316\uff1a<\/strong> \u4f7f\u7528\u5177\u6709\u66f4\u9ad8\u6027\u80fd\u7684\u8ba1\u7b97\u673a\u786c\u4ef6\uff0c\u4f8b\u5982\u66f4\u591a\u7684CPU\u6838\u5fc3\u3001\u66f4\u5feb\u7684\u5b58\u50a8\u5668\u6216\u66f4\u5927\u7684\u5185\u5b58\u7b49\uff0c\u53ef\u4ee5\u8fdb\u4e00\u6b65\u63d0\u9ad8\u8bad\u7ec3\u901f\u5ea6\u3002<\/p>\n<\/li>\n<\/ol>\n<p>\u901a\u8fc7\u7ed3\u5408\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u4f18\u5316TensorFlow\u6a21\u578b\u7684\u8bad\u7ec3\u901f\u5ea6\uff0c\u5e76\u52a0\u5feb\u6a21\u578b\u7684\u6536\u655b\u8fc7\u7a0b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"TensorFlow 2.3\u548c1.3\u8fd0\u884c\u76f8\u540c\u4ee3\u7801\u6548\u679c\u5b58\u5728\u663e\u8457\u5dee\u5f02\u7684\u539f\u56e0\u4e3b\u8981\u6709\uff1a\u5e95\u5c42\u67b6\u6784\u7684\u66f4\u65b0\u3001\u9ed8\u8ba4\u7684Eager [&hellip;]","protected":false},"author":3,"featured_media":227381,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/227366"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=227366"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/227366\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/227381"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=227366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=227366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=227366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}