{"id":25635,"date":"2023-10-20T06:49:36","date_gmt":"2023-12-06T01:07:33","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85tensorflow%e3%80%82-4\/"},"modified":"2025-08-11T15:09:57","modified_gmt":"2025-08-11T07:09:57","slug":"%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85tensorflow%e3%80%82-4","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85tensorflow%e3%80%82-4\/","title":{"rendered":"\u5728Ubuntu\u4e0a\u5b89\u88c5TensorFlow"},"content":{"rendered":"<h3>\u7a0b\u5e8f\u5305\u66f4\u65b0<\/h3>\n<pre class=\"post-pre\"><code>$ sudo apt-get update\r\n<\/code><\/pre>\n<h3>\u786e\u8ba4Python\u7684\u7248\u672c<\/h3>\n<pre class=\"post-pre\"><code>$ python -V\r\nPython 2.7.9\r\n<\/code><\/pre>\n<h3>\u4f7f\u7528pip\u8fdb\u884c\u5b89\u88c5<\/h3>\n<pre class=\"post-pre\"><code>$ sudo apt-get install python-pip python-dev\r\n<\/code><\/pre>\n<h3>\u5b89\u88c5TensorFlow<\/h3>\n<pre class=\"post-pre\"><code># CPU\u306e\u307f \u4eca\u56de\u306f\u3053\u3063\u3061\r\n$ sudo pip install --upgrade https:\/\/storage.googleapis.com\/tensorflow\/linux\/cpu\/tensorflow-0.7.1-cp27-none-linux_x86_64.whl\r\n\r\n# GPU\u306f\u3053\u3063\u3061\r\n$ sudo pip install --upgrade https:\/\/storage.googleapis.com\/tensorflow\/linux\/gpu\/tensorflow-0.7.1-cp27-none-linux_x86_64.whl\r\n\r\n<\/code><\/pre>\n<h3>\u5728\u8003\u8bd5\u4e2d\u8bd5\u7740\u8fd0\u884c\u4e00\u4e0b\u3002<\/h3>\n<pre class=\"post-pre\"><code>$ python\r\n\r\n&gt;&gt;&gt; import tensorflow as tf\r\n&gt;&gt;&gt; hello = tf.constant('Hello, TensorFlow!')\r\n&gt;&gt;&gt; sess = tf.Session()\r\n&gt;&gt;&gt; sess.run(hello)\r\nHello, TensorFlow!\r\n&gt;&gt;&gt; a = tf.constant(10)\r\n&gt;&gt;&gt; b = tf.constant(32)\r\n&gt;&gt;&gt; sess.run(a+b)\r\n42\r\n&gt;&gt;&gt;\r\n\r\n<\/code><\/pre>\n<p>\u52a8\u4e86\u8d77\u6765 le q\u01d0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7a0b\u5e8f\u5305\u66f4\u65b0 $ sudo apt-get update \u786e\u8ba4Python\u7684\u7248\u672c $ python -V Pyt [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[227],"class_list":["post-25635","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-227"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728Ubuntu\u4e0a\u5b89\u88c5TensorFlow - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u5173\u4e8e\u5728Ubuntu\u4e0a\u5b89\u88c5TensorFlow\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728ubuntu\u4e0a\u5b89\u88c5tensorflow\u3002-4\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728Ubuntu\u4e0a\u5b89\u88c5TensorFlow\" \/>\n<meta property=\"og:description\" content=\"\u5173\u4e8e\u5728Ubuntu\u4e0a\u5b89\u88c5TensorFlow\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728ubuntu\u4e0a\u5b89\u88c5tensorflow\u3002-4\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-06T01:07:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-11T07:09:57+00:00\" \/>\n<meta name=\"author\" content=\"\u5b87, \u534e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5b87, \u534e\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85tensorflow%e3%80%82-4\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85tensorflow%e3%80%82-4\/\",\"name\":\"\u5728Ubuntu\u4e0a\u5b89\u88c5TensorFlow - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-12-06T01:07:33+00:00\",\"dateModified\":\"2025-08-11T07:09:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\"},\"description\":\"\u5173\u4e8e\u5728Ubuntu\u4e0a\u5b89\u88c5TensorFlow\u7684\u6280\u672f\u6587\u7ae0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85tensorflow%e3%80%82-4\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85tensorflow%e3%80%82-4\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85tensorflow%e3%80%82-4\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728Ubuntu\u4e0a\u5b89\u88c5TensorFlow\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\",\"name\":\"\u5b87, \u534e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"caption\":\"\u5b87, \u534e\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85tensorflow%e3%80%82-4\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5728Ubuntu\u4e0a\u5b89\u88c5TensorFlow - Blog - Silicon Cloud","description":"\u5173\u4e8e\u5728Ubuntu\u4e0a\u5b89\u88c5TensorFlow\u7684\u6280\u672f\u6587\u7ae0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728ubuntu\u4e0a\u5b89\u88c5tensorflow\u3002-4\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5728Ubuntu\u4e0a\u5b89\u88c5TensorFlow","og_description":"\u5173\u4e8e\u5728Ubuntu\u4e0a\u5b89\u88c5TensorFlow\u7684\u6280\u672f\u6587\u7ae0","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728ubuntu\u4e0a\u5b89\u88c5tensorflow\u3002-4\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-12-06T01:07:33+00:00","article_modified_time":"2025-08-11T07:09:57+00:00","author":"\u5b87, \u534e","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u5b87, \u534e","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85tensorflow%e3%80%82-4\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85tensorflow%e3%80%82-4\/","name":"\u5728Ubuntu\u4e0a\u5b89\u88c5TensorFlow - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-12-06T01:07:33+00:00","dateModified":"2025-08-11T07:09:57+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458"},"description":"\u5173\u4e8e\u5728Ubuntu\u4e0a\u5b89\u88c5TensorFlow\u7684\u6280\u672f\u6587\u7ae0","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85tensorflow%e3%80%82-4\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85tensorflow%e3%80%82-4\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85tensorflow%e3%80%82-4\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5728Ubuntu\u4e0a\u5b89\u88c5TensorFlow"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458","name":"\u5b87, \u534e","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","caption":"\u5b87, \u534e"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85tensorflow%e3%80%82-4\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/25635","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=25635"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/25635\/revisions"}],"predecessor-version":[{"id":96296,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/25635\/revisions\/96296"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=25635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=25635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=25635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}