{"id":1610,"date":"2022-01-25T11:40:20","date_gmt":"2022-01-25T02:40:20","guid":{"rendered":"https:\/\/aiacademy.jp\/media\/?p=1610"},"modified":"2024-08-06T18:12:33","modified_gmt":"2024-08-06T09:12:33","slug":"%e3%80%90python%e3%80%91attributeerror-module-tensorflow-has-no-attribute-get_default_graph-%e8%a7%a3%e6%b1%ba%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/aiacademy.jp\/media\/?p=1610","title":{"rendered":"\u3010Python\u3011AttributeError: module &#8216;tensorflow&#8217; has no attribute &#8216;get_default_graph&#8217;  \u89e3\u6c7a\u65b9\u6cd5"},"content":{"rendered":"<div id=\"sgb-css-id-1\">\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-font-size is-style-fill has-medium-font-size\"><a class=\"wp-block-button__link has-vivid-green-cyan-background-color has-background wp-element-button\" href=\"https:\/\/lin.ee\/3E4GzWk\" rel=\"nofollow noopener\" target=\"_blank\">LINE\u53cb\u3060\u3061\u767b\u9332 \u25b6 Python\u30b3\u30fc\u30b9 \u25b6 \u53d7\u8b1b\u5272\u5f15\u30af\u30fc\u30dd\u30f3 \u7121\u6599\u52d5\u753b<\/a><\/div>\n<\/div>\n<\/div>\n\n\n<h1 class=\"wp-block-heading\" id=\"i-0\">AttributeError: module \u2018tensorflow\u2019 has no attribute \u2018get_default_graph\u2019<\/h1>\n\n\n\n<p><\/p>\n\n\n\n<p>Keras\u3068TensorFlow\u3001Python\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u3063\u3066\u306f\u300cAttributeError: module \u2018tensorflow\u2019 has no attribute \u2018get_default_graph\u2019\u300d\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"i-1\">\u74b0\u5883<\/h1>\n\n\n\n<p>\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u74b0\u5883\u306f\u4ee5\u4e0b\u306e\u901a\u308a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>keras\uff1a2.2.4\nTensorFlow\uff1a2.4.2\nPython\uff1aPython 3.8.11<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8a18\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u6642\u3001\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8aad\u307f\u8fbc\u3080\u3068\u300cAttributeError: module \u2018tensorflow\u2019 has no attribute \u2018get_default_graph\u2019\u300d\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from keras.models import Sequential\nfrom keras.layers import Dense, Activation\nfrom keras.layers.core import Dropout\nfrom keras.layers.normalization import BatchNormalization<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"i-2\">\u89e3\u6c7a\u7b56<\/h1>\n\n\n\n<p>import \u3057\u3066\u3044\u308b\u3000keras\u306e\u524d\u306b<meta charset=\"utf-8\"><code><strong>tensorflow.python<\/strong>.keras<\/code> \u3092\u8ffd\u52a0\u30fb\u5909\u66f4\u3059\u308c\u3070\u89e3\u6c7a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from tensorflow.python.keras.models import Sequential\nfrom tensorflow.python.keras.layers import Dense, Activation\nfrom tensorflow.python.keras.layers.core import Dropout\nfrom tensorflow.python.keras.layers.normalization import BatchNormalization<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8a18\u3067\u6b63\u3057\u304f\u8aad\u307f\u8fbc\u307f\u304c\u51fa\u6765\u3001\u305d\u306e\u5f8c\u306e\u30e2\u30c7\u30eb\u69cb\u7bc9\u3084\u5b66\u7fd2\u51e6\u7406\u7b49\u3082\u7121\u4e8b\u5b8c\u4e86\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"i-3\">\u8cea\u554f\u3057\u653e\u984c\u306e\u74b0\u5883\u30671\u65e5\u3042\u305f\u308a\u306e\u8cbb\u7528194\u5186\u3067\u5b66\u3079\u308b\uff01\u696d\u754c\u6700\u5b89\u5024\u30aa\u30f3\u30e9\u30a4\u30f3AI\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30ebAI Academy Bootcamp<\/h1>\n\n\n\n<p><a href=\"https:\/\/aiacademy.jp\/bootcamp\/\">AI Academy Bootcamp<\/a>\u306e\u300c<a href=\"https:\/\/aiacademy.jp\/bootcamp\/\">\u30aa\u30f3\u30c7\u30de\u30f3\u30c9\u52d5\u753b\uff0b\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u30c8\u30d7\u30e9\u30f3<\/a>\u300d\u306f\uff16\u30f6\u6708\u8cea\u554f\u3057\u653e\u984c\u3067\u53d7\u8b1b\u6599\u304c35,000\u5186\uff08\u7a0e\u8fbc\uff09\u3067\u3054\u53d7\u8b1b\u9802\u3051\u307e\u3059\u3002<br>1\u65e5\u306e\u53d7\u8b1b\u8cbb\u7528\u63db\u7b97\u3067\u3001\u306a\u3093\u3068194\u5186\u3067\u3054\u53d7\u8b1b\u9802\u3051\u307e\u3059\u3002<\/p>\n\n\n\n<p>450\u7a2e\u985e\u306e\u30aa\u30ea\u30b8\u30ca\u30eb\u30c6\u30ad\u30b9\u30c8\u30b3\u30f3\u30c6\u30f3\u30c4\u306b\u52a0\u3048\u30015\u3064\u306e\u52d5\u753b\u30b3\u30fc\u30b9\uff08AI\u30d7\u30e9\u30f3\u30ca\u30fc\u30b3\u30fc\u30b9\u3001\u521d\u3081\u3066\u306ePython\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3001Python\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5165\u9580\u30b3\u30fc\u30b9\u3001\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30c6\u30a3\u30b9\u30c8\u30b3\u30fc\u30b9\u3001\u6a5f\u68b0\u5b66\u7fd2\u30a8\u30f3\u30b8\u30cb\u30a2\u30b3\u30fc\u30b9\uff09\u3082\u3054\u53d7\u8b1b\u9802\u3051\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u696d\u754c\u6700\u5b89\u5024\u3067\u3001\u3069\u3053\u3088\u308a\u3082\u304a\u5f97\u306b\u3001\u52b9\u7387\u3088\u304fAI\u30b9\u30ad\u30eb\u3092\u8eab\u306b\u4ed8\u3051\u305f\u3044\u65b9\u3001AI\u4eba\u6750\u3068\u3057\u3066\u8ee2\u8077\u3057\u305f\u3044\u65b9\u306f\u662f\u975e\u3054\u53d7\u8b1b\u3054\u691c\u8a0e\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/aiacademy.jp\/bootcamp\/\">AI Academy&nbsp;Bootcamp<\/a><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/aiacademy.jp\/bootcamp\/\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"341\" src=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2021\/12\/bootcamp_ad_72ppi-1024x341.png\" alt=\"\" class=\"wp-image-691\" srcset=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2021\/12\/bootcamp_ad_72ppi-1024x341.png 1024w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2021\/12\/bootcamp_ad_72ppi-300x100.png 300w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2021\/12\/bootcamp_ad_72ppi-768x256.png 768w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2021\/12\/bootcamp_ad_72ppi-940x313.png 940w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2021\/12\/bootcamp_ad_72ppi.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\"><\/a><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>AttributeError: module \u2018tensorflow\u2019 has no attribute \u2018get_default_graph\u2019 Keras\u3068TensorFlow\u3001Python\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u3063\u3066\u306f\u300cAt &#8230; <\/p>\n","protected":false},"author":1,"featured_media":1613,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85,165],"tags":[],"class_list":{"0":"post-1610","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python","8":"category-165"},"_links":{"self":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts\/1610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1610"}],"version-history":[{"count":4,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts\/1610\/revisions"}],"predecessor-version":[{"id":4789,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts\/1610\/revisions\/4789"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/media\/1613"}],"wp:attachment":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}