{"id":5339,"date":"2022-04-21T11:11:39","date_gmt":"2022-04-21T03:11:39","guid":{"rendered":"http:\/\/123.57.164.21\/?p=5339"},"modified":"2022-04-21T11:11:39","modified_gmt":"2022-04-21T03:11:39","slug":"%e4%bb%8e%e9%9b%b6%e5%bc%80%e5%a7%8b%e5%ad%a6tensorflow%e3%80%9001-%e6%90%ad%e5%bb%ba%e7%8e%af%e5%a2%83%e3%80%81helloworld%e7%af%87%e3%80%91","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=5339","title":{"rendered":"\u4ece\u96f6\u5f00\u59cb\u5b66TensorFlow\u301001-\u642d\u5efa\u73af\u5883\u3001HelloWorld\u7bc7\u3011"},"content":{"rendered":"\n<p><strong>\u524d\u8a00<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u53ea\u6709\u5149\u5934\u624d\u80fd\u53d8\u5f3a\u3002<\/p><p>\u6587\u672c\u5df2\u6536\u5f55\u81f3\u6211\u7684GitHub\u4ed3\u5e93\uff0c\u6b22\u8fceStar\uff1ahttps:\/\/github.com\/ZhongFuCheng3y\/3y<\/p><\/blockquote>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-16.png\" alt=\"\" class=\"wp-image-5340\" width=\"302\" height=\"285\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-16.png 508w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-16-300x283.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-16-230x217.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-16-350x331.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-16-480x454.png 480w\" sizes=\"(max-width: 302px) 100vw, 302px\" \/><\/figure><\/div>\n\n\n\n<p>\u6700\u8fd1\u5728\u5b66\u4e60TensorFlow\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u4e86\u89e3\u4e86TensorFlow\u4e00\u4e9b\u57fa\u7840\u7684\u77e5\u8bc6\uff0c\u73b0\u5728\u5468\u672b\u6709\u7a7a\u4e86\uff0c\u5c31\u5199\u5199\u4e00\u4e9b\u7b14\u8bb0\uff0c\u8bb0\u5f55\u4e00\u4e0b\u81ea\u5df1\u7684\u6210\u957f~<\/p>\n\n\n\n<p>\u603b\u7684\u6765\u8bf4\uff0cTensorFlow\u8fd8\u662f\u4e00\u4e2a\u6bd4\u8f83\u65b0\u7684\u6280\u672f\uff0c\u6709\u5174\u8da3\u7684\u540c\u5b66\u4e0d\u59a8\u8ddf\u7740\u6211\u7684\u7b14\u8bb0\uff0c\u4e00\u8d77\u5b66\u5b66\u5457(\u53cd\u6b63\u6ca1\u574f\u5904)~<\/p>\n\n\n\n<p>\u524d\u9762\u56de\u987e\uff1a<\/p>\n\n\n\n<ul><li><a href=\"https:\/\/mp.weixin.qq.com\/s?__biz=MzI4Njg5MDA5NA==&amp;mid=2247484534&amp;idx=1&amp;sn=813981af9fb77c9dee1b399bbde84846&amp;chksm=ebd74577dca0cc617cf326f3f589794eace2dd87a932e7e4a958dc462d45b159a13d286a751a&amp;token=1712662964&amp;lang=zh_CN&amp;scene=21#wechat_redirect\">\u5916\u884c\u4eba\u90fd\u80fd\u770b\u5f97\u61c2\u7684\u673a\u5668\u5b66\u4e60\uff0c\u9519\u8fc7\u4e86\u8840\u4e8f\uff01<\/a><\/li><li><a href=\"https:\/\/mp.weixin.qq.com\/s?__biz=MzI4Njg5MDA5NA==&amp;mid=2247484911&amp;idx=1&amp;sn=fc2172d52ac306fab19f7c69c0e11718&amp;chksm=ebd744eedca0cdf8012186adb1b4996802e5ba7eac058f50ca2f9184b1ca9e42c8a14e82096f&amp;token=1800133466&amp;lang=zh_CN&amp;scene=21#wechat_redirect\">\u8fd9\u662f\u6211\u770b\u8fc7\u6700\u597d\u7684\u300c\u673a\u5668\u5b66\u4e60\u300d\u79d1\u666e\u6587\u7ae0\u4e86<\/a><\/li><li><a href=\"https:\/\/mp.weixin.qq.com\/s?__biz=MzI4Njg5MDA5NA==&amp;mid=2247484923&amp;idx=1&amp;sn=1c3637726478be04db55a91ba238e174&amp;chksm=ebd744fadca0cdec7588e1886ea95ace662eacb0a59b149a3b34e8b79afa5b0e9208aca55e5f&amp;token=1032095965&amp;lang=zh_CN&amp;scene=21#wechat_redirect\">\u795e\u7ecf\u7f51\u7edc\u6d45\u8bb2\uff1a\u4ece\u795e\u7ecf\u5143\u5230\u6df1\u5ea6\u5b66\u4e60<\/a><\/li><\/ul>\n\n\n\n<p><strong>\u4e00\u3001\u5b89\u88c5Tensorflow\u6240\u9700\u8981\u7684\u73af\u5883<\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignleft size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"67\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-17-1024x67.png\" alt=\"\" class=\"wp-image-5341\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-17-1024x67.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-17-300x20.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-17-768x51.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-17-830x55.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-17-230x15.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-17-350x23.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-17-480x32.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-17.png 1368w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p><p>\u4f7f\u7528\u73af\u5883\uff1aMac<\/p><\/p>\n\n\n\n<p>Python\u6709\u597d\u591a\u4e2a\u7248\u672c\uff0c\u5728Mac\u4e2d\u81ea\u5e26\u7684Python\u7248\u672c\u662f<code>2.7<\/code>\uff0c\u4f46\u76f8\u5bf9\u800c\u8a00\u6bd4\u8f83\u8001\u4e86\u3002\u73b0\u5728\u4e00\u822c\u7528<code>Python3.x<\/code>\u4e86\uff0c\u672c\u6b21\u4e0b\u8f7d\u7684\u7248\u672c\u662f<code>3.5.6<\/code><\/p>\n\n\n\n<p>\u6211\u5b89\u88c5Python\u6240\u4f7f\u7528\u65b9\u6cd5\u7684\u5927\u81f4\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<ul><li>\u5b89\u88c5Homebrew<\/li><li>\u5b89\u88c5pyenv<\/li><li>\u5728<code>.bash_profile<\/code>\u6dfb\u52a0\u73af\u5883\u53d8\u91cf<\/li><li>\u8ba9\u73af\u5883\u53d8\u91cf\u751f\u6548<\/li><li>\u5b89\u88c5<code>3.X\u7248\u672cpython<\/code><\/li><\/ul>\n\n\n\n<p>\u8be6\u60c5\u53ef\u53c2\u8003\u5982\u4e0b\u7684\u94fe\u63a5(\u603b\u7684\u6765\u8bf4\uff0c\u6211\u6839\u636e\u4e0b\u9762\u7684\u6559\u7a0b\u4e00\u4e0b\u5b50\u5c31\u5b89\u88c5\u4e86\u6211\u60f3\u8981\u7684Python\u7248\u672c\uff0c\u8fd8\u662f\u975e\u5e38\u4e0d\u9519\u7684\u3002)\uff1a<\/p>\n\n\n\n<ul><li>Mac\u4e0b\u5b89\u88c5\u591a\u7248\u672cpython\uff1a<ul><li>https:\/\/www.cnblogs.com\/webgiser\/p\/7463974.html<\/li><\/ul><\/li><li>pyenv\u76f8\u5173\u7684\u547d\u4ee4(\u5e38\u7528\u7684pyenv\u547d\u4ee4):<ul><li>https:\/\/www.jianshu.com\/p\/af1f8d7b6b31<\/li><\/ul><\/li><\/ul>\n\n\n\n<p>\u5728\u5b89\u88c5Python\u7684\u65f6\u5019\u4e5f\u53d1\u73b0\u4e86\u4e00\u4e2a\u5c0f\u77e5\u8bc6\u70b9\uff1a<\/p>\n\n\n\n<ul><li>Mac\u4e00\u822c\u4f7f\u7528bash\u4f5c\u4e3a\u9ed8\u8ba4\u7684shell\uff0c\u4f1a\u6709\u597d\u51e0\u4e2a\u73af\u5883\u53d8\u91cf\uff0c\u5176\u4e2d<code>etc\/profile<\/code>\u662f<strong>\u7cfb\u7edf\u7ea7<\/strong>\u7684\uff0c\u8fd8\u6709\u51e0\u4e2a<strong>\u7528\u6237\u7ea7\u522b<\/strong>\u7684\u73af\u5883\u53d8\u91cf\uff0c\u6bd4\u5982\u8bf4\uff1a<code>~\/.bash_profile<\/code><\/li><li>\u5982\u679c\u4fee\u6539\u7684\u662f\u7cfb\u7edf\u7ea7\u522b\u7684\u73af\u5883\u53d8\u91cf\uff0c\u4e5f\u5c31\u662f<code>etc\/profile<\/code>\uff0c\u5728\u4fdd\u5b58\u7684\u65f6\u5019\u53ea\u80fd\u662f<code>:wq<\/code>!\u8986\u76d6\uff0c\u4e0d\u7136\u4f1a\u51fa\u73b0readonly\u9519\u8bef<\/li><\/ul>\n\n\n\n<p>(\u81f3\u4e8eTensorFlow\u548cnumpy\u4f9d\u8d56\u7684\u4e0b\u8f7d\uff0c\u8fd9\u91cc\u6211\u5c31\u4e0d\u8bf4\u4e86\uff0c\u5c31\u4e24\u6761\u547d\u4ee4\u5c31\u641e\u6382\u5566)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"67\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-18-1024x67.png\" alt=\"\" class=\"wp-image-5344\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-18-1024x67.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-18-300x20.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-18-768x50.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-18-830x54.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-18-230x15.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-18-350x23.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-18-480x31.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-18.png 1412w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Java\u6709<code>IDEA<\/code>\u795e\u5668\uff0c\u540c\u6837\u7684\uff0cPython\u4e5f\u6709<code>PyCharm<\/code>\uff0c\u540c\u6837\u662fJetBrains\u51fa\u4ea7\u7684\u3002<\/p>\n\n\n\n<p>\u628aPycharm\u5b89\u88c5\u597d\u4e86\u4e4b\u540e\uff0c\u6211\u60f3\u5f53\u7136\u5c31<code>new project<\/code>\u53bb\u7528\u4e86\uff0c\u7136\u540e\u5c31<code>next,next,next<\/code>\uff0c\u5f53\u6210IDEA\u6765\u7528\u3002\u4f46\u53d1\u73b0\u4e86\u4e00\u4e2a\u95ee\u9898\uff1a\u6211\u5728\u4e4b\u524d<strong>\u660e\u660e\u88c5\u597d\u4e86<\/strong>TensorFlow\u548cnumpy\u7684\u4f9d\u8d56\uff0c\u5728PyCharm\u73af\u5883\u4e0b\u5374<strong>\u8bc6\u522b\u4e0d\u51fa\u6765<\/strong>\uff01\u5728<strong>\u547d\u4ee4\u884c<\/strong>\u7a97\u53e3\u4e0b\uff0c\u4f9d\u8d56\u662f\u5b58\u5728\u7684\uff01<\/p>\n\n\n\n<p>\u540e\u6765\u624d\u53d1\u73b0\uff1a\u5982\u679c\u7528PyCharm\u53bbnew\u4e00\u4e2aproject\uff0c\u4f1a<strong>\u9ed8\u8ba4\u5efa\u4e00\u4e2a\u89e3\u6790\u5668<\/strong>\u5728\u5f53\u524d\u7684\u9879\u76ee\u76ee\u5f55\u4e0b\u3002\u800cPyCharm\u4f1a\u9075\u5b88\u201c\u5c31\u8fd1\u539f\u5219\u201d\u4f7f\u7528\u5f53\u524d\u9879\u76ee\u8def\u5f84\u4e0b\u7684\u89e3\u6790\u5668\u3002\u800c\u6211\u4eec\u6dfb\u52a0\u7684\u4f9d\u8d56(TensorFlow\u3001numpy)\u662f\u5728\u6211\u4eec\u5b89\u88c5Python\u7684\u8def\u5f84\u4e0b\u7684\uff0c\u8fd9\u5c31\u5bfc\u81f4\u4e86\u5728\u547d\u4ee4\u884c\u4e0b\u627e\u5230\u4f9d\u8d56\uff0c\u800c\u5728PyCharm\u4e2d\u627e\u4e0d\u5230\u4f9d\u8d56\u3002<\/p>\n\n\n\n<p>\u89e3\u51b3\u4e5f\u5f88\u7b80\u5355\uff1a\u5728PyCharm<strong>\u6307\u5b9a<\/strong>\u4e00\u4e0b\u6211\u4eec\u5b89\u88c5Python\u7684\u8def\u5f84\uff0c\u5207\u6362\u4e00\u4e0b\u5c31\u597d\u4e86\u3002<\/p>\n\n\n\n<p>\u53c2\u8003\u8d44\u6599\uff1a<\/p>\n\n\n\n<ul><li>\u5173\u4e8epip\u5b89\u88c5\u7b2c\u4e09\u65b9\u5e93\uff0c\u4f46pycharm\u4e2d\u5374\u65e0\u6cd5\u8bc6\u522b\u7684\u95ee\u9898\uff1b\u4ee5\u53capycharm\u5b89\u88c5\u7b2c\u4e09\u65b9\u5e93\u7684\u65b9\u6cd5\u89e3\u6790<ul><li>https:\/\/blog.csdn.net\/weixin_41287260\/article\/details\/83957731<\/li><\/ul><\/li><\/ul>\n\n\n\n<p><strong>\u4e8c\u3001\u4f53\u9a8cTensorFlow<\/strong><\/p>\n\n\n\n<p>\u597d\u7684\uff0c\u6211\u4eec\u73b0\u5728\u5df2\u7ecf\u5b89\u88c5\u597dTensorFlow\u6240\u9700\u8981\u7684\u73af\u5883\u4e86\uff01(\u770b\u8d77\u6765\u597d\u7b80\u5355\uff0c\u4f46\u8fd8\u662f\u82b1\u4e86\u6211\u4e0d\u5c11\u65f6\u95f4\u2026.)<\/p>\n\n\n\n<p>\u5b98\u7f51\u7684Demo\u94fe\u63a5(\u9700\u8981\u79d1\u5b66\u4e0a\u7f51)\uff1a<\/p>\n\n\n\n<ul><li>https:\/\/www.tensorflow.org\/tutorials\/keras\/basic_classification<\/li><\/ul>\n\n\n\n<p>\u9996\u5148\u6211\u4eec\u6765\u770b\u4e00\u4e0b\u8fd9\u4e2a\u4f8b\u5b50\u53ef\u4ee5\u5e72\u4e9b\u4ec0\u4e48\uff1a\u6211\u4eec\u6709\u975e\u5e38\u591a\u5f20\u7684\u56fe\u7247(<strong>\u6570\u636e\u96c6<\/strong>)\uff0c\u8fd9\u4e9b\u56fe\u7247\u6709\u4e0d\u540c\u7684\u7c7b\u578b(\u6bd4\u5982\u8863\u670d\u3001\u978b\u5b50\u3001\u88e4\u5b50\uff0c<strong>\u4e00\u5171\u670910\u79cd\u7c7b\u578b<\/strong>)\uff0c\u628a\u8fd9\u4e9b\u6570\u636e\u96c6\u6254\u8fdb\u6211\u4eec\u7684\u795e\u7ecf\u7f51\u7edc\u91cc\u5934\uff0c\u751f\u6210\u51fa<strong>\u6a21\u578b<\/strong>\u3002\u6709\u4e86\u6a21\u578b\u4ee5\u540e\uff0c\u5f53\u6211\u4eec\u518d\u5c06\u7c7b\u4f3c\u7684\u56fe\u7247\u6254\u8fdb\u53bb\uff0c\u8fd9\u4e2a\u6a21\u578b\u53ef\u4ee5\u5e2e\u6211\u4eec<strong>\u9884\u6d4b<\/strong>\u8fd9\u5f20\u56fe\u7247\u662f\u8863\u670d\u8fd8\u662f\u978b\u5b50\u8fd8\u662f\u88e4\u5b50\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-19-1024x853.png\" alt=\"\" class=\"wp-image-5348\" width=\"543\" height=\"452\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-19-1024x853.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-19-300x250.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-19-768x640.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-19-830x692.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-19-230x192.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-19-350x292.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-19-480x400.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-19.png 1368w\" sizes=\"(max-width: 543px) 100vw, 543px\" \/><figcaption>\u6570\u636e\u96c6<\/figcaption><\/figure><\/div>\n\n\n\n<p>\u968f\u540e\uff0c\u6211\u8ddf\u7740\u5b98\u7f51\u7684\u4ee3\u7801\u8dd1\u4e86\u4e00(\u4ee3\u7801\u6211\u90fd\u53ea\u662f\u4e00\u6b65\u4e00\u6b65<strong>\u590d\u5236\u7c98\u8d34<\/strong>)\uff0c\u6700\u540e\u8dd1\u8d77\u6765\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># TensorFlow and tf.keras\nimport tensorflow as tf\nfrom tensorflow import keras\n\n# Helper libraries\nimport numpy as np\n\nprint(tf.__version__)\n\n# \u52a0\u8f7d\u6570\u636e\u3001\u533a\u5206\u51fa\u6d4b\u8bd5\u6570\u636e\u548c\u8bad\u7ec3\u6570\u636e\n# \u6ce8\u610f\uff1a\u5982\u679c\u5df2\u7ecf\u4e0b\u8fc7\uff0c\u91cd\u590d\u4e0b\u8f7d\u7684\u8bdd\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0EOFError: Compressed file ended before the end-of-stream marker was reached\u9519\u8bef\n\nfashion_mnist = keras.datasets.fashion_mnist\n(train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data()\n\n# \u5206\u7c7b\u7684\u5217\u8868\nclass_names = ['T-shirt\/top', 'Trouser', 'Pullover', 'Dress', 'Coat',\n               'Sandal', 'Shirt', 'Sneaker', 'Bag', 'Ankle boot']\n\n# \u67e5\u770b\u6570\u636e\u7684\u503c\nprint(train_images.shape)  # \u6837\u672c\u7684shape(\u53ef\u4ee5\u770b\u51fa\u6709\u591a\u5c11\u6761\u6837\u672c\u3001\u7ef4\u5ea6)\nprint(len(train_labels))  # label\u7684\u4e2a\u6570\uff0c\u6709\u591a\u5c11\u4e2a\u6837\u672c\uff0c\u5c31\u5e94\u8be5\u6709\u591a\u5c11\u4e2alabel\nprint(train_labels)  # label\u7684\u503c\uff0c\u5bf9\u5e94\u4e0a\u9762\u5206\u7c7b\u5217\u8868(\u4ece0\u52309)\n\n\n# \u5bf9\u6d4b\u8bd5\u6570\u636e\u548c\u8bad\u7ec3\u6570\u636e\u8fdb\u884c\u9884\u5904\u7406(\u5b9e\u9645\u4e0a\u5c31\u662f\u5f52\u4e00\u5316)\ntrain_images = train_images \/ 255.0\ntest_images = test_images \/ 255.0\n\n# \u8bbe\u7f6e\u5c42  (\u521d\u59cb\u5904\u7406)--- \u5efa\u7acb\u795e\u7ecf\u5c42\nmodel = keras.Sequential([\n    keras.layers.Flatten(input_shape=(28, 28)),\n    keras.layers.Dense(128, activation=tf.nn.relu),\n    keras.layers.Dense(10, activation=tf.nn.softmax)\n])\n\n\n# \u635f\u5931\u51fd\u6570\u3001\u4f18\u5316\u5668\u3001\u6307\u6807\nmodel.compile(optimizer=tf.train.AdamOptimizer(),\n              loss='sparse_categorical_crossentropy',\n              metrics=['accuracy'])\n\n# \u5c06\u8bad\u7ec3\u96c6\u4e22\u8fdb\u53bb\uff0c\u8bad\u7ec3\u51fa\u6a21\u578b(Model)\nmodel.fit(train_images, train_labels, epochs=5)\n\n# \u5c06\u6d4b\u8bd5\u6570\u636e\u4e22\u5230\u6a21\u578b\u4e2d\uff0c\u8bc4\u4f30\u4e00\u4e0b\u5f97\u5206(\u51c6\u786e\u7387)\ntest_loss, test_acc = model.evaluate(test_images, test_labels)\nprint('Test accuracy:', test_acc)\n\n# \u8bc4\u4f30\u5b8c\u51c6\u786e\u7387\u4ee5\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u5bf9\u6d4b\u8bd5\u6570\u636e\u8fdb\u884c\u9884\u6d4b\npredictions = model.predict(test_images)\n\n# \u9009\u7b2c\u4e00\u4e2a\u6837\u672c\u9884\u6d4b\u540e\u7684\u5f97\u51fa\u6700\u6709\u53ef\u80fd\u7ed3\u679c\nprint(np.argmax(predictions[0]))\n\n# \u5bf9\u6bd4\u7ed3\u679c\nprint(test_labels[0])\n\n<\/pre>\n\n\n\n<p>\u8dd1\u51fa\u6765\u7684\u7ed3\u679c\uff1a<\/p>\n\n\n\n<p><strong>(\u540e\u671f\u6ce8\u91ca\uff1a\u8fd9\u662fTensorFlow\u7684\u7248\u672c)<\/strong><\/p>\n\n\n\n<p><code>1.12.0<\/code><\/p>\n\n\n\n<p><strong>(\u540e\u671f\u6ce8\u91ca\uff1a\u8fd9\u662fTensorFlow\u4e0b\u8f7d\u6570\u636e\u96c6\u7684\u65e5\u5fd7)<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Downloading data from https:\/\/storage.googleapis.com\/tensorflow\/tf-keras-datasets\/train-labels-idx1-ubyte.gz\n32768\/29515 [=================================] - 0s 3us\/step\nDownloading data from https:\/\/storage.googleapis.com\/tensorflow\/tf-keras-datasets\/train-images-idx3-ubyte.gz\n\n26427392\/26421880 [==============================] - 12s 0us\/step\nDownloading data from https:\/\/storage.googleapis.com\/tensorflow\/tf-keras-datasets\/t10k-labels-idx1-ubyte.gz\n8192\/5148 [===============================================] - 0s 0us\/step\nDownloading data from https:\/\/storage.googleapis.com\/tensorflow\/tf-keras-datasets\/t10k-images-idx3-ubyte.gz\n\n4423680\/4422102 [==============================] - 2s 0us\/step<\/pre>\n\n\n\n<p><strong>(\u540e\u671f\u6ce8\u91ca\uff1a\u6837\u672c\u7684shape)<\/strong><\/p>\n\n\n\n<p><code>(60000, 28, 28)<\/code><\/p>\n\n\n\n<p><strong>(\u540e\u671f\u6ce8\u91ca\uff1a\u6837\u672c\u6709\u591a\u5c11\u6761\uff0c\u5bf9\u5e94\u7684label\u5c31\u6709\u591a\u5c11\u6761)<\/strong><\/p>\n\n\n\n<p><code>60000<\/code><\/p>\n\n\n\n<p><strong>(\u540e\u671f\u6ce8\u91ca\uff1alabel\u7684\u503c\u662f\u4ece0-9\uff0c\u8868\u793a\u6709\u4e5d\u79cd\u7c7b\u522b)<\/strong><\/p>\n\n\n\n<p><code>[9 0 0 ... 3 0 5]<\/code><\/p>\n\n\n\n<p><strong>(\u540e\u671f\u6ce8\u91ca\uff1a\u5f00\u59cb\u8bad\u7ec3)<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Epoch 1\/5\n2019-02-19 14:00:46.842852: I tensorflow\/core\/platform\/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA\n\n60000\/60000 [==============================] - 4s 65us\/step - loss: 0.4995 - acc: 0.8246\nEpoch 2\/5\n60000\/60000 [==============================] - 4s 62us\/step - loss: 0.3734 - acc: 0.8655\nEpoch 3\/5\n60000\/60000 [==============================] - 4s 63us\/step - loss: 0.3346 - acc: 0.8788\nEpoch 4\/5\n60000\/60000 [==============================] - 4s 63us\/step - loss: 0.3102 - acc: 0.8861\nEpoch 5\/5\n60000\/60000 [==============================] - 4s 63us\/step - loss: 0.2918 - acc: 0.8916\n\n10000\/10000 [==============================] - 0s 36us\/step<\/pre>\n\n\n\n<p><strong>(\u540e\u671f\u6ce8\u91ca\uff1a\u9884\u6d4b\u51fa\u6765\u7684\u7cbe\u786e\u5ea6)<\/strong><\/p>\n\n\n\n<p><code>Test accuracy: 0.8514<\/code><\/p>\n\n\n\n<p><strong>(\u540e\u671f\u6ce8\u91ca\uff1a\u9009\u7b2c\u4e00\u4e2a\u6837\u672c\u8fdb\u884c\u9884\u6d4b\uff0c\u5e76\u5bf9\u6bd4\u5b9e\u9645\u7684\u7ed3\u679c)<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">9\n9<\/pre>\n\n\n\n<p>\u53c2\u8003\u8d44\u6599\uff1a<\/p>\n\n\n\n<ul><li>TensorFlow\u5b98\u7f51\u7684\u4f8b\u5b50(\u9700\u8981\u79d1\u5b66\u4e0a\u7f51\u624d\u80fd\u8fdb..)<\/li><li>Tensorflow\u5b66\u4e60\u7b14\u8bb0\u4e4b\u4e00\uff1a\u8bad\u7ec3\u4f60\u7684\u7b2c\u4e00\u4e2a\u795e\u7ecf\u7f51\u7edc\u2014\u2014\u57fa\u7840\u5206\u7c7b<ul><li>https:\/\/www.jianshu.com\/p\/d4fb3a391d22<\/li><\/ul><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"70\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-20-1024x70.png\" alt=\"\" class=\"wp-image-5349\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-20-1024x70.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-20-300x20.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-20-768x52.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-20-830x57.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-20-230x16.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-20-350x24.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-20-480x33.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-20.png 1378w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul start=\"2\"><li><strong>\u52a0\u8f7d<\/strong>\u6570\u636e\uff1a\u4f7f\u7528dataset\u7684api\u52a0\u8f7d\u6570\u636e\uff0c\u5e76\u5c06\u6570\u636e\u96c6<strong>\u5206\u6210<\/strong>\u8bad\u7ec3\u6570\u636e\u548c\u6d4b\u8bd5\u6570\u636e<\/li><li><strong>\u68c0\u67e5<\/strong>\u6570\u636e\uff1a\u68c0\u67e5<strong>dataSet<\/strong>\u7684\u6570\u636e\u6709\u6ca1\u6709\u95ee\u9898(\u4f8b\u5982\uff0c\u6837\u672c\u7684\u8bb0\u5f55\u6570\u3001label\u7684\u8bb0\u5f55\u6570\u7b49)<\/li><li>\u5bf9\u6570\u636e<strong>\u9884\u5904\u7406<\/strong>\uff1a\u5bf9\u6d4b\u8bd5\u6570\u636e\u548c\u8bad\u7ec3\u6570\u636e\u8fdb\u884c<strong>\u5f52\u4e00\u5316<\/strong>\u5904\u7406\uff0c\u76ee\u7684\uff1a\u51cf\u5c11\u56e0\u4e3a\u6570\u503c\u7684\u5927\u5c0f\u6240\u5e26\u6765\u7684\u5f71\u54cd(<strong>\u4e00\u822c\u6211\u4eec\u4f1a\u5c06\u503c\u90fd\u7f29\u5c0f\u5728\u4e00\u4e2a\u5c0f\u7684\u8303\u56f4\u5185<\/strong>)<\/li><li><strong>\u5efa\u7acb\u795e\u7ecf\u7f51\u7edc<\/strong>\uff1a(\u8f93\u5165\u5c42\u3001\u9690\u85cf\u5c42\u3001\u8f93\u51fa\u5c42)<\/li><li>\u4e3a\u6a21\u578b\u5b9a\u4e49\u635f\u5931\u51fd\u6570\u3001\u4f18\u5316\u5668\u3001\u6307\u6807<\/li><li>\u5c06\u8bad\u7ec3\u6570\u636e\u4e22\u8fdb\u6211\u4eec\u7684\u795e\u7ecf\u7f51\u7edc\u4e2d\uff0c\u751f\u6210\u51faModel<\/li><li>\u5c06\u6d4b\u8bd5\u6570\u636e\u4e22\u8fdb\u6211\u4eec\u751f\u6210\u597d\u7684Model\u8fdb\u884c<strong>\u8bc4\u4f30<\/strong>\uff0c\u9884\u6d4b\u51fa\u6211\u4eec\u7684\u51c6\u786e\u7387<\/li><\/ul>\n\n\n\n<p><strong>\u4e09\u3001TensorFlow\u4ecb\u7ecd<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"67\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-21-1024x67.png\" alt=\"\" class=\"wp-image-5350\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-21-1024x67.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-21-300x20.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-21-768x50.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-21-830x54.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-21-230x15.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-21-350x23.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-21-480x31.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-21.png 1376w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u5982\u679c\u53bbGoogle\u641c\u5173\u952e\u5b57\u201cTensorFlow\u201d\uff0c\u90a3\u53ef\u80fd\u4f60\u4f1a\u770b\u5230\u8fd9\u4e48\u4e00\u53e5\u8bdd\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>An open source machine learning framework for everyone.<\/p><\/blockquote>\n\n\n\n<p>\u6ca1\u9519\uff0cTensorFlow\u5c31\u662f\u4e00\u4e2a\u673a\u5668\u5b66\u4e60\u7684<strong>\u6846\u67b6<\/strong>\u3002\u81f3\u4e8e\u6846\u67b6\uff0c\u76f8\u4fe1\u5927\u5bb6\u4e5f\u6bd4\u8f83\u597d\u7406\u89e3\u4e86\uff1b\u7c7b\u6bd4\u5230Java\uff0c\u6bd4\u5982\u8bf4\u6211\u4eec\u7684Spring\u6846\u67b6\u7ed9\u6211\u4eec\u5c01\u88c5\u4e86\u597d\u591a\u597d\u7528\u7684API\uff0c\u7b80\u5316\u6211\u4eec\u7684\u5f00\u53d1(\u60f3\u60f3\u5f53\u5e74\u5199Servlet\u7684\u65f6\u5019\uff01)<\/p>\n\n\n\n<p>TensorFlow\u4f5c\u4e3a\u673a\u5668\u5b66\u4e60\u7684\u6846\u67b6\uff0c\u540c\u6837\u4e5f\u7ed9\u6211\u4eec\u5c01\u88c5\u4e86\u597d\u591a\u597d\u7528\u7684API\uff0c\u80fd\u591f<strong>\u964d\u4f4e<\/strong>\u5b66\u4e60\u673a\u5668\u5b66\u4e60\u7684<strong>\u95e8\u69db<\/strong>\u3002<\/p>\n\n\n\n<ul><li>\u5c31\u62ff\u4e0a\u9762\u7684\u4f8b\u5b50\u6765\u8bf4\uff0c\u6ca1\u60f3\u5230<strong>\u90a3\u4e48\u5c11\u7684\u4ee3\u7801<\/strong>\u5c31\u53ef\u4ee5\u8dd1\u673a\u5668\u5b66\u4e60\u7684\u201cHelloWorld\u201d\u4e86\uff01<\/li><\/ul>\n\n\n\n<p>\u81f3\u4e8e\u673a\u5668\u5b66\u4e60\u548c\u795e\u7ecf\u7f51\u7edc\u7684\u76f8\u5173\u57fa\u7840\uff0c\u6211<strong>\u5f3a\u70c8<\/strong>\u5efa\u8bae\u8bfb\u8bfb\u8fd9\u4e24\u7bc7\u6587\u7ae0\uff01\u901a\u4fd7\u6613\u61c2\u7684<strong>\u79d1\u666e<\/strong>\u6587\u7ae0\uff1a<\/p>\n\n\n\n<ul><li><a href=\"https:\/\/mp.weixin.qq.com\/s?__biz=MzI4Njg5MDA5NA==&amp;mid=2247484911&amp;idx=1&amp;sn=fc2172d52ac306fab19f7c69c0e11718&amp;chksm=ebd744eedca0cdf8012186adb1b4996802e5ba7eac058f50ca2f9184b1ca9e42c8a14e82096f&amp;token=1800133466&amp;lang=zh_CN&amp;scene=21#wechat_redirect\">\u8fd9\u662f\u6211\u770b\u8fc7\u6700\u597d\u7684\u300c\u673a\u5668\u5b66\u4e60\u300d\u79d1\u666e\u6587\u7ae0\u4e86<\/a><\/li><li><a href=\"https:\/\/mp.weixin.qq.com\/s?__biz=MzI4Njg5MDA5NA==&amp;mid=2247484923&amp;idx=1&amp;sn=1c3637726478be04db55a91ba238e174&amp;chksm=ebd744fadca0cdec7588e1886ea95ace662eacb0a59b149a3b34e8b79afa5b0e9208aca55e5f&amp;token=1032095965&amp;lang=zh_CN&amp;scene=21#wechat_redirect\">\u795e\u7ecf\u7f51\u7edc\u6d45\u8bb2\uff1a\u4ece\u795e\u7ecf\u5143\u5230\u6df1\u5ea6\u5b66\u4e60<\/a><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"68\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-22-1024x68.png\" alt=\"\" class=\"wp-image-5351\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-22-1024x68.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-22-300x20.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-22-768x51.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-22-830x55.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-22-230x15.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-22-350x23.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-22-480x32.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-22.png 1388w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u6211\u4eec\u53ef\u4ee5\u53d1\u73b0\u4e0a\u9762\u7684Demo\u6240\u7528\u7684\u57fa\u7840\u8bed\u8a00\u662fPython\uff0c\u4f46\u4e0d\u8981\u8ba4\u4e3aTensorFlow\u5c31\u662fPython\u7684\u4e00\u4e2a\u6846\u67b6\u3002\u6211\u770b\u5230\u8fc7\u4e00\u4e2a\u6bd4\u55bb\uff0c\u89c9\u5f97\u5199\u5f97\u633a\u597d\u7684\uff0c\u7c98\u8d34\u4e00\u4e0b\uff1a<\/p>\n\n\n\n<p>Python \u548c Tensorflow \u4e4b\u95f4\u7684\u8054\u7cfb\uff0c\u53ef\u4ee5\u7c7b\u6bd4 Javascript \u548c HTML \u4e4b\u95f4\u7684\u5173\u7cfb\u3002Javascript \u662f\u4e00\u79cd\u5168\u529f\u80fd\u7684\u7f16\u7a0b\u8bed\u8a00\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5404\u79cd\u51fa\u8272\u7684\u6548\u679c\u3002HTML \u662f\u7528\u4e8e\u8868\u793a\u67d0\u79cd\u7c7b\u578b\u7684\u5b9e\u7528\u8ba1\u7b97\u62bd\u8c61\uff08\u8fd9\u91cc\u6307\u7684\u662f\u53ef\u7531 Web \u6d4f\u89c8\u5668\u5448\u73b0\u7684\u5185\u5bb9\uff09\u7684\u6846\u67b6\u3002Javascript \u5728\u4ea4\u4e92\u5f0f\u7f51\u9875\u4e2d\u7684\u4f5c\u7528\u662f<strong>\u7ec4\u88c5\u6d4f\u89c8\u5668\u770b\u5230\u7684 HTML \u5bf9\u8c61<\/strong>\uff0c\u7136\u540e\u5728\u9700\u8981\u65f6\u901a\u8fc7\u5c06\u5176\u66f4\u65b0\u4e3a\u65b0\u7684 HTML \u6765\u4e0e\u5176\u4ea4\u4e92\u3002<\/p>\n\n\n\n<ul><li>\u4f5c\u8005\uff1aAI\u524d\u7ebf<\/li><li>\u94fe\u63a5\uff1ahttps:\/\/juejin.im\/post\/5b345a49f265da599c561b25<\/li><\/ul>\n\n\n\n<p>\u4e0b\u9762\u518d\u6765\u770b\u770bTensorFlow\u7684\u67b6\u6784\u56fe(Python<strong>\u53ea\u662f<\/strong>\u5bf9TensorFlow\u8fdb\u884c\u4e86\u5c01\u88c5)<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-23-1024x419.png\" alt=\"\" class=\"wp-image-5352\" width=\"594\" height=\"242\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-23-1024x419.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-23-300x123.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-23-768x314.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-23-830x339.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-23-230x94.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-23-350x143.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-23-480x196.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-23.png 1350w\" sizes=\"(max-width: 594px) 100vw, 594px\" \/><figcaption>Python\u5c01\u88c5\u4e86TensorFlow\u5f15\u64ce<\/figcaption><\/figure><\/div>\n\n\n\n<p>TensorFlow\u7684\u5f15\u64ce\u4e5f\u662f\u5206\u4e86\u5f88\u591a\u6a21\u5757\u7684(\u8fd9\u91cc\u6211\u4eec\u7b80\u5355\u4e86\u89e3\u4e00\u4e0b)\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-24-1024x560.png\" alt=\"\" class=\"wp-image-5353\" width=\"585\" height=\"320\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-24-1024x560.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-24-300x164.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-24-768x420.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-24-830x454.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-24-230x126.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-24-350x192.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-24-480x263.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/04\/\u56fe\u7247-24.png 1334w\" sizes=\"(max-width: 585px) 100vw, 585px\" \/><figcaption>TensorFlow\u67b6\u6784<\/figcaption><\/figure><\/div>\n\n\n\n<p><strong>\u6700\u540e<\/strong><\/p>\n\n\n\n<p>\u603b\u7ed3\u4e00\u4e0b\u8fd9\u7bc7\u6587\u7ae0\uff1a<\/p>\n\n\n\n<ul><li>\u5b89\u88c5TensorFlow\u5fc5\u8981\u7684\u73af\u5883<\/li><li>\u8ddf\u7740\u5b98\u65b9\u6587\u6863\uff0c<strong>\u4f53\u9a8c<\/strong>\u4e00\u4e0bTensorFlow(\u673a\u5668\u5b66\u4e60)\u7684\u201cHelloWorld\u201d<ul><li>\u6839\u636e\u7ed9\u51fa\u7684\u4f8b\u5b50\uff0c<strong>\u731c\u51fa<\/strong>\u4f7f\u7528TensorFlow(\u673a\u5668\u5b66\u4e60)\u65f6\u9700\u8981\u505a\u54ea\u4e9b\u6b65\u9aa4<\/li><\/ul><\/li><li>TensorFlow\u5c31\u662f\u4e00\u4e2a\u673a\u5668\u5b66\u4e60(\u6df1\u5ea6\u5b66\u4e60)\u7684\u6846\u67b6\uff0c\u63d0\u4f9b\u4e86\u5f88\u591a<strong>\u5b9e\u7528<\/strong>\u7684API\u65b9\u4fbf\u6211\u4eec\u53bb\u73a9\u673a\u5668\u5b66\u4e60(\u6df1\u5ea6\u5b66\u4e60)\u3002<\/li><\/ul>\n\n\n\n<p>\u76f8\u4fe1\u770b\u5230\u8fd9\u91cc\uff0c\u5f88\u591a\u4eba\u90fd\u8ddf\u6211\u4e4b\u524d\u4e00\u6837\uff0c<strong>\u4e00\u8138\u61f5\u903c<\/strong>\u3002\u5bf9\u5b98\u65b9\u7ed9\u51fa\u7684\u4f8b\u5b50\u4e2d\u7684API\u4e0d\u719f\u6089\uff0c\u53bb\u67e5\u9605\u76f8\u5173\u8d44\u6599\u7684\u65f6\u5019\u53c8\u53d1\u73b0\u6709\u597d\u591a\u673a\u5668\u5b66\u4e60\u76f8\u5173\u7684<strong>\u672f\u8bed<\/strong>\uff0c\u5bf9\u8fd9\u4e9b\u672f\u8bed\u53c8\u4e0d\u4e86\u89e3\u3002\u7136\u540e\u5c31\u5faa\u73af\u61f5\u903c..<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">while(true){\n    \/\/ \u5faa\u73af\u61f5\u903c..\n}<\/pre>\n\n\n\n<p>\u5176\u5b9e\u56de\u60f3<strong>\u521a\u5b66Java\u7684\u65f6\u5019<\/strong>\uff0c\u4e5f\u662f\u8fd9\u4e48\u4e00\u4e2a\u8fc7\u7a0b\uff0c\u5f53\u4f60\u4ece\u5c4f\u5e55\u770b\u5230\u201cHelloWorld\u201d\u4e86\u4ee5\u540e\uff0c<strong>\u5927\u6982\u7387<\/strong>\u6765\u8bf4\u4e5f\u662f\u4e0d\u4e86\u89e3\u76f8\u5173\u7684API\u5177\u4f53\u505a\u4e86\u4ec0\u4e48\u4e8b(\u751a\u81f3\u8fdeAPI\u90fd\u4e0d\u77e5\u9053\u662f\u5565\u610f\u601d)\u3002\u4f46\u82b1\u4e00\u6bb5\u65f6\u95f4\u53bb\u5b66\u4e60\u4e86\u4ee5\u540e\uff0c\u5c31\u4f1a\u53d1\u73b0\uff0c\u539f\u6765HelloWorld\u662f\u771f\u7684\u7b80\u5355\uff01<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public static void main(String[] args) {\n\n    System.out.println(\"Hello World\");\n\n}<\/pre>\n\n\n\n<p>\u540e\u7eed\u6211\u4f1a\u7ee7\u7eed\u66f4\u65b0\u6211\u5b66\u4e60TensorFlow\u65f6\u7684\u4e00\u4e9b<strong>\u7b14\u8bb0<\/strong>\uff0c\u6709\u5174\u8da3\u7684\u5c0f\u4f19\u4f34\u4e0d\u59a8\u8ddf\u7740\u6211\u4e00\u8d77\u5b66\u4e60~<\/p>\n\n\n\n<p>\u53e6\u5916\uff0c\u4ece\u6587\u7ae0\u7684\u5f00\u5934\u6211\u4e5f\u5df2\u7ecf\u8bf4\u4e86\uff0c\u6211\u5bf9Python\u3001\u673a\u5668\u5b66\u4e60\u90fd\u662f\u6ca1\u6709\u76f8\u5173\u57fa\u7840\u7684\uff0c\u5982\u679c\u6709\u5199\u9519\u7684\u5730\u65b9\u4e0d\u59a8\u5728\u8bc4\u8bba\u533a\u7559\u8a00\u6307\u6b63\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u53ea\u6709\u5149\u5934\u624d\u80fd\u53d8\u5f3a\u3002 \u6587\u672c\u5df2\u6536\u5f55\u81f3\u6211\u7684GitHub\u4ed3\u5e93\uff0c\u6b22\u8fceStar\uff1ahttps:\/\/github.com [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/5339"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5339"}],"version-history":[{"count":6,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/5339\/revisions"}],"predecessor-version":[{"id":5354,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/5339\/revisions\/5354"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}