{"id":51459,"date":"2024-10-08T18:48:14","date_gmt":"2024-10-08T10:48:14","guid":{"rendered":"https:\/\/server.hk\/cnblog\/51459\/"},"modified":"2024-11-14T10:43:10","modified_gmt":"2024-11-14T02:43:10","slug":"ubuntu-16-04-%e4%b8%8b-python-2-7-%e5%ae%89%e8%a3%9d-tensorflow","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/51459\/","title":{"rendered":"Ubuntu 16.04 \u4e0b Python 2.7 \u5b89\u88dd TensorFlow"},"content":{"rendered":"<h1 id=\"ubuntu-16-04-%e4%b8%8b-python-2-7-%e5%ae%89%e8%a3%9d-tensorflow-WCsmjexqkQ\">Ubuntu 16.04 \u4e0b Python 2.7 \u5b89\u88dd TensorFlow<\/h1>\n<p>TensorFlow \u662f\u4e00\u500b\u7531 Google \u958b\u767c\u7684\u958b\u6e90\u6a5f\u5668\u5b78\u7fd2\u6846\u67b6\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u6df1\u5ea6\u5b78\u7fd2\u548c\u6578\u64da\u5206\u6790\u3002\u96d6\u7136 TensorFlow \u7684\u6700\u65b0\u7248\u672c\u5df2\u7d93\u4e0d\u518d\u652f\u6301 Python 2.7\uff0c\u4f46\u5728\u67d0\u4e9b\u60c5\u6cc1\u4e0b\uff0c\u4ecd\u7136\u9700\u8981\u5728 Ubuntu 16.04 \u4e0a\u5b89\u88dd Python 2.7 \u7248\u672c\u7684 TensorFlow\u3002\u672c\u6587\u5c07\u6307\u5c0e\u60a8\u5982\u4f55\u5728 Ubuntu 16.04 \u4e0a\u5b89\u88dd Python 2.7 \u7248\u672c\u7684 TensorFlow\u3002<\/p>\n<h2 id=\"%e5%89%8d%e7%bd%ae%e6%a2%9d%e4%bb%b6-WCsmjexqkQ\">\u524d\u7f6e\u689d\u4ef6<\/h2>\n<p>\u5728\u958b\u59cb\u5b89\u88dd\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u78ba\u4fdd\u60a8\u7684\u7cfb\u7d71\u4e0a\u5df2\u7d93\u5b89\u88dd\u4e86\u4ee5\u4e0b\u8edf\u4ef6\uff1a<\/p>\n<ul>\n<li>Ubuntu 16.04 \u64cd\u4f5c\u7cfb\u7d71<\/li>\n<li>Python 2.7<\/li>\n<li>pip\uff08Python \u7684\u5305\u7ba1\u7406\u5de5\u5177\uff09<\/li>\n<\/ul>\n<h2 id=\"%e5%ae%89%e8%a3%9d-python-2-7-WCsmjexqkQ\">\u5b89\u88dd Python 2.7<\/h2>\n<p>\u5982\u679c\u60a8\u7684\u7cfb\u7d71\u5c1a\u672a\u5b89\u88dd Python 2.7\uff0c\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u547d\u4ee4\u9032\u884c\u5b89\u88dd\uff1a<\/p>\n<pre><code>sudo apt update\nsudo apt install python2.7 python-pip<\/code><\/pre>\n<h2 id=\"%e5%ae%89%e8%a3%9d-tensorflow-WCsmjexqkQ\">\u5b89\u88dd TensorFlow<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 pip \u5b89\u88dd TensorFlow\u3002\u7531\u65bc TensorFlow \u7684\u6700\u65b0\u7248\u672c\u4e0d\u518d\u652f\u6301 Python 2.7\uff0c\u60a8\u9700\u8981\u5b89\u88dd\u4e00\u500b\u8f03\u820a\u7684\u7248\u672c\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd TensorFlow 1.15 \u7684\u6b65\u9a5f\uff1a<\/p>\n<pre><code>pip install tensorflow==1.15.0<\/code><\/pre>\n<p>\u9019\u689d\u547d\u4ee4\u5c07\u6703\u5b89\u88dd TensorFlow 1.15 \u7248\u672c\uff0c\u9019\u662f\u6700\u5f8c\u4e00\u500b\u652f\u6301 Python 2.7 \u7684\u7248\u672c\u3002<\/p>\n<h2 id=\"%e9%a9%97%e8%ad%89%e5%ae%89%e8%a3%9d-WCsmjexqkQ\">\u9a57\u8b49\u5b89\u88dd<\/h2>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u547d\u4ee4\u4f86\u9a57\u8b49 TensorFlow \u662f\u5426\u5b89\u88dd\u6210\u529f\uff1a<\/p>\n<pre><code>python2.7 -c \"import tensorflow as tf; print(tf.__version__)\"<\/code><\/pre>\n<p>\u5982\u679c\u5b89\u88dd\u6210\u529f\uff0c\u60a8\u61c9\u8a72\u6703\u770b\u5230\u8f38\u51fa\u986f\u793a TensorFlow \u7684\u7248\u672c\u865f\uff081.15.0\uff09\u3002<\/p>\n<h2 id=\"%e5%b8%b8%e8%a6%8b%e5%95%8f%e9%a1%8c-WCsmjexqkQ\">\u5e38\u898b\u554f\u984c<\/h2>\n<h3 id=\"1-%e7%82%ba%e4%bb%80%e9%ba%bc%e9%81%b8%e6%93%87-python-2-7%ef%bc%9f-WCsmjexqkQ\">1. \u70ba\u4ec0\u9ebc\u9078\u64c7 Python 2.7\uff1f<\/h3>\n<p>\u96d6\u7136 Python 2.7 \u5df2\u7d93\u5728 2020 \u5e74\u505c\u6b62\u652f\u6301\uff0c\u4f46\u67d0\u4e9b\u820a\u7684\u9805\u76ee\u6216\u4ee3\u78bc\u5eab\u4ecd\u7136\u4f9d\u8cf4\u65bc\u6b64\u7248\u672c\u3002\u9019\u4f7f\u5f97\u5728\u7279\u5b9a\u60c5\u6cc1\u4e0b\uff0c\u4f7f\u7528 Python 2.7 \u4ecd\u7136\u662f\u5fc5\u8981\u7684\u3002<\/p>\n<h3 id=\"2-%e5%a6%82%e4%bd%95%e8%99%95%e7%90%86%e4%be%9d%e8%b3%b4%e5%95%8f%e9%a1%8c%ef%bc%9f-WCsmjexqkQ\">2. \u5982\u4f55\u8655\u7406\u4f9d\u8cf4\u554f\u984c\uff1f<\/h3>\n<p>\u5728\u5b89\u88dd TensorFlow \u6642\uff0c\u53ef\u80fd\u6703\u9047\u5230\u4f9d\u8cf4\u554f\u984c\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u5b89\u88dd\u6240\u9700\u7684\u4f9d\u8cf4\uff1a<\/p>\n<pre><code>sudo apt install libatlas-base-dev<\/code><\/pre>\n<h3 id=\"3-%e6%98%af%e5%90%a6%e5%8f%af%e4%bb%a5%e5%9c%a8%e5%85%b6%e4%bb%96%e7%89%88%e6%9c%ac%e7%9a%84-ubuntu-%e4%b8%8a%e5%ae%89%e8%a3%9d%ef%bc%9f-WCsmjexqkQ\">3. \u662f\u5426\u53ef\u4ee5\u5728\u5176\u4ed6\u7248\u672c\u7684 Ubuntu \u4e0a\u5b89\u88dd\uff1f<\/h3>\n<p>\u96d6\u7136\u672c\u6587\u4e3b\u8981\u91dd\u5c0d Ubuntu 16.04\uff0c\u4f46\u60a8\u4e5f\u53ef\u4ee5\u5728\u5176\u4ed6\u7248\u672c\u7684 Ubuntu \u4e0a\u5b89\u88dd Python 2.7 \u548c TensorFlow\uff0c\u53ea\u9700\u6839\u64da\u76f8\u61c9\u7684\u7248\u672c\u9032\u884c\u8abf\u6574\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-WCsmjexqkQ\">\u7e3d\u7d50<\/h2>\n<p>\u5728 Ubuntu 16.04 \u4e0a\u5b89\u88dd Python 2.7 \u7248\u672c\u7684 TensorFlow \u662f\u4e00\u500b\u76f8\u5c0d\u7c21\u55ae\u7684\u904e\u7a0b\u3002\u901a\u904e\u4e0a\u8ff0\u6b65\u9a5f\uff0c\u60a8\u53ef\u4ee5\u8f15\u9b06\u5730\u8a2d\u7f6e\u60a8\u7684\u958b\u767c\u74b0\u5883\uff0c\u4e26\u958b\u59cb\u4f7f\u7528 TensorFlow \u9032\u884c\u6a5f\u5668\u5b78\u7fd2\u9805\u76ee\u3002\u5982\u679c\u60a8\u9700\u8981\u66f4\u9ad8\u6548\u7684\u904b\u884c\u74b0\u5883\uff0c\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u4f86\u90e8\u7f72\u60a8\u7684\u61c9\u7528\u7a0b\u5e8f\uff0c\u9019\u6a23\u53ef\u4ee5\u7372\u5f97\u66f4\u597d\u7684\u6027\u80fd\u548c\u7a69\u5b9a\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to install TensorFlow on Python 2.7 in Ubuntu 16.04 with this step-by-step guide for seamless setup and configuration.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-51459","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/51459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=51459"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/51459\/revisions"}],"predecessor-version":[{"id":51460,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/51459\/revisions\/51460"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=51459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=51459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=51459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}