{"id":46498,"date":"2023-09-25T14:37:52","date_gmt":"2023-02-08T03:07:52","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/46498-2\/"},"modified":"2024-05-04T01:30:38","modified_gmt":"2024-05-03T17:30:38","slug":"46498-2","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/46498-2\/","title":{"rendered":""},"content":{"rendered":"<h1>\u3010\u7b2c1\u56de\u3011Python\u3067\u306f\u3058\u3081\u308b\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0<\/h1>\n<p>Python\u3067\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u306e\u52c9\u5f37\u3092\u59cb\u3081\u307e\u3057\u305f\u3002\u66f8\u7c4d\u300c\u3044\u3061\u3070\u3093\u3084\u3055\u3057\u3044\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u5165\u9580\u6559\u5ba4\u300d\u3092\u53c2\u8003\u306b\u3057\u3066\u3001\u3084\u3063\u305f\u3053\u3068\u3084\u8e93\u3044\u305f\u3053\u3068\u8a18\u8f09\u3057\u3066\u304d\u307e\u3059\u3002\u4eca\u56de\u306f\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b\u3064\u3044\u3066\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<h3>\u74b0\u5883<\/h3>\n<p>Ubuntu 18.04<\/p>\n<h3>Python\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/h3>\n<pre class=\"post-pre\"><code>apt <span class=\"nb\">install <\/span>python3-pip python3-dev\r\n<\/code><\/pre>\n<h3>\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>TensorFlow\u3068Keras\u3001Jupyter\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>pip3 <span class=\"nb\">install <\/span>tensorflow\r\npip3 <span class=\"nb\">install <\/span>keras\r\npip3 <span class=\"nb\">install <\/span>jupyter\r\n<\/code><\/pre>\n<p>\u66f8\u7c4d\u3067\u306fAnaconda\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u3001numpy\u3001scipy\u3001yaml\u3001h5py\u306e\uff14\u3064\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u3068\u3042\u308a\u307e\u3057\u304c\u3001keras\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u6642\u70b9\u3067\u4f9d\u5b58\u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u3057\u3066\u4e00\u7dd2\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u306e\u3067\u3001Anacoda\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u306a\u304b\u3063\u305f\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>root@ubuntu:~# pip3 show keras\r\nName: Keras\r\nVersion: 2.1.6\r\nSummary: Deep Learning <span class=\"k\">for <\/span>humans\r\nHome-page: https:\/\/github.com\/keras-team\/keras\r\nAuthor: Francois Chollet\r\nAuthor-email: francois.chollet@gmail.com\r\nLicense: MIT\r\nLocation: \/usr\/local\/lib\/python3.6\/dist-packages\r\nRequires: scipy, h5py, six, pyyaml, numpy\r\n<\/code><\/pre>\n<h3>TensorFlow\u306e\u5b9f\u884c<\/h3>\n<pre class=\"post-pre\"><code><span class=\"c1\"># Python\r\n<\/span><span class=\"kn\">import<\/span> <span class=\"nn\">tensorflow<\/span> <span class=\"k\">as<\/span> <span class=\"n\">tf<\/span>\r\n<span class=\"n\">hello<\/span> <span class=\"o\">=<\/span> <span class=\"n\">tf<\/span><span class=\"p\">.<\/span><span class=\"n\">constant<\/span><span class=\"p\">(<\/span><span class=\"s\">'Hello, TensorFlow!'<\/span><span class=\"p\">)<\/span>\r\n<span class=\"n\">sess<\/span> <span class=\"o\">=<\/span> <span class=\"n\">tf<\/span><span class=\"p\">.<\/span><span class=\"n\">Session<\/span><span class=\"p\">()<\/span>\r\n<span class=\"k\">print<\/span><span class=\"p\">(<\/span><span class=\"n\">sess<\/span><span class=\"p\">.<\/span><span class=\"n\">run<\/span><span class=\"p\">(<\/span><span class=\"n\">hello<\/span><span class=\"p\">))<\/span>\r\n<\/code><\/pre>\n<p>\u6b21\u306e\u51fa\u529b\u304c\u3042\u308c\u3070\u3001TensorFlow\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4f5c\u6210\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>b<span class=\"s1\">'Hello, TensorFlow!'<\/span>\r\n<\/code><\/pre>\n<h3>Keras\u306e\u5b9f\u884c<\/h3>\n<p>\u30a8\u30e9\u30fc\u306a\u304f\u5b9f\u884c\u3067\u304d\u308c\u3070\u3001Keras\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"kn\">from<\/span> <span class=\"nn\">keras.models<\/span> <span class=\"kn\">import<\/span> <span class=\"n\">Sequential<\/span>\r\n<span class=\"n\">model<\/span> <span class=\"o\">=<\/span> <span class=\"n\">Sequential<\/span><span class=\"p\">()<\/span>\r\n<\/code><\/pre>\n<h3>Jupyter\u306e\u5b9f\u884c<\/h3>\n<p>Jupyter\u3092\u5b9f\u884c\u3057\u3066\u3001http:\/\/localhost:8888\/?token=xxxx\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u5fc5\u8981\u306b\u5fdc\u3058\u3067\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code>jupyter notebook <span class=\"nt\">--ip<\/span><span class=\"o\">=<\/span><span class=\"k\">*<\/span> <span class=\"nt\">--no-browser<\/span> <span class=\"nt\">--allow-root<\/span>\r\n<\/code><\/pre>\n<div>\n<div class=\"post-table\">\u30aa\u30d7\u30b7\u30e7\u30f3\u8aac\u660e&#8211;ip=[ip]notbook\u30b5\u30fc\u30d0\u30fc\u3067\u53d7\u3051\u4ed8\u3051\u308bIP\u30a2\u30c9\u30ec\u30b9\u3002&#8211;no-browser\u8d77\u52d5\u5f8c\u306b\u30d6\u30e9\u30a6\u30b6\u3092\u958b\u304b\u306a\u3044\u3002&#8211;allow-rootroot\u30e6\u30fc\u30b6\u3067notebook\u306e\u5b9f\u884c\u3092\u8a31\u53ef\u3059\u308b\u3002<\/div>\n<\/div>\n<h3>Jupyter\u306e\u8a2d\u5b9a<\/h3>\n<p>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306f~\/.jupyter\/jupyter_notebook_config.py\u306b\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>jupyter notebook <span class=\"nt\">--generate-config<\/span>\r\n<\/code><\/pre>\n<p>notebook\u30b5\u30fc\u30d0\u30fc\u3067\u53d7\u3051\u4ed8\u3051\u308bIP\u30a2\u30c9\u30ec\u30b9\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u5168\u3066\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u53d7\u3051\u4ed8\u3051\u308b\u306b\u306f0.0.0.0\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\">## The IP address the notebook server will listen on.<\/span>\r\n<span class=\"c\">#c.NotebookApp.ip = 'localhost'<\/span>\r\nc.NotebookApp.ip <span class=\"o\">=<\/span> <span class=\"s1\">'0.0.0.0'<\/span>\r\n<\/code><\/pre>\n<p>\u8d77\u52d5\u5f8c\u306b\u30d6\u30e9\u30a6\u30b6\u3092\u958b\u304d\u307e\u3059\u3002False\u3092\u8a2d\u5b9a\u3059\u308b\u3068\u8d77\u52d5\u5f8c\u306b\u30d6\u30e9\u30a6\u30b6\u3092\u958b\u304d\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\">## Whether to open in a browser after starting. The specific browser used is<\/span>\r\n<span class=\"c\">#  platform dependent and determined by the python standard library `webbrowser`<\/span>\r\n<span class=\"c\">#  module, unless it is overridden using the --browser (NotebookApp.browser)<\/span>\r\n<span class=\"c\">#  configuration option.<\/span>\r\n<span class=\"c\">#c.NotebookApp.open_browser = True<\/span>\r\nc.NotebookApp.open_browser <span class=\"o\">=<\/span> False\r\n<\/code><\/pre>\n<p>root\u30e6\u30fc\u30b6\u3067notebook\u306e\u5b9f\u884c\u3092\u8a31\u53ef\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\">## Whether to allow the user to run the notebook as root.<\/span>\r\n<span class=\"c\">#c.NotebookApp.allow_root = False<\/span>\r\nc.NotebookApp.allow_root <span class=\"o\">=<\/span> True\r\n<\/code><\/pre>\n<h2>\u53c2\u8003\u6587\u732e<\/h2>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Installing TensorFlow on Ubuntu \u00a0|\u00a0 TensorFlow<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Keras Documentation<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Project Jupyter | Install<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Packages for 64-bit Linux with Python 3.6 | Anaconda: Documentation<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">jupyter notebook \u3067\u5916\u90e8\u304b\u3089\u306e\u63a5\u7d9a\u3092\u8a31\u53ef\u3059\u308b &#8211; Qiita<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u7b2c1\u56de\u3011Python\u3067\u306f\u3058\u3081\u308b\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0 Python\u3067\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u306e\u52c9\u5f37\u3092\u59cb\u3081\u307e\u3057\u305f\u3002\u66f8\u7c4d\u300c [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-46498","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"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>- Blog - Silicon Cloud<\/title>\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\/46498-2\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:description\" content=\"\u3010\u7b2c1\u56de\u3011Python\u3067\u306f\u3058\u3081\u308b\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0 Python\u3067\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u306e\u52c9\u5f37\u3092\u59cb\u3081\u307e\u3057\u305f\u3002\u66f8\u7c4d\u300c [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/46498-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-08T03:07:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-03T17:30:38+00:00\" \/>\n<meta name=\"author\" content=\"\u96c5, \u609f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u96c5, \u609f\" \/>\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\/46498-2\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/46498-2\/\",\"name\":\"- Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-02-08T03:07:52+00:00\",\"dateModified\":\"2024-05-03T17:30:38+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/46498-2\/\"]}]},{\"@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\/f044a4b7fa4ee2701702942002419ca6\",\"name\":\"\u96c5, \u609f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"caption\":\"\u96c5, \u609f\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/46498-2\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"- Blog - Silicon Cloud","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\/46498-2\/","og_locale":"zh_CN","og_type":"article","og_description":"\u3010\u7b2c1\u56de\u3011Python\u3067\u306f\u3058\u3081\u308b\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0 Python\u3067\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u306e\u52c9\u5f37\u3092\u59cb\u3081\u307e\u3057\u305f\u3002\u66f8\u7c4d\u300c [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/46498-2\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-02-08T03:07:52+00:00","article_modified_time":"2024-05-03T17:30:38+00:00","author":"\u96c5, \u609f","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u96c5, \u609f","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/46498-2\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/46498-2\/","name":"- Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-02-08T03:07:52+00:00","dateModified":"2024-05-03T17:30:38+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/46498-2\/"]}]},{"@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\/f044a4b7fa4ee2701702942002419ca6","name":"\u96c5, \u609f","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","caption":"\u96c5, \u609f"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/46498-2\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/46498","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\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=46498"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/46498\/revisions"}],"predecessor-version":[{"id":95300,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/46498\/revisions\/95300"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=46498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=46498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=46498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}