{"id":957,"date":"2019-01-15T22:45:39","date_gmt":"2019-01-15T20:45:39","guid":{"rendered":"http:\/\/ideee.3deee.ch\/?p=957"},"modified":"2019-01-18T18:34:14","modified_gmt":"2019-01-18T16:34:14","slug":"using-google-colab-with-gpu-or-tpu","status":"publish","type":"post","link":"https:\/\/ideee.3deee.ch\/?p=957","title":{"rendered":"Using Google CoLab with GPU or TPU"},"content":{"rendered":"\n<p>If you just want to test a deep learning model quickly, you can use the online tool <a href=\"https:\/\/colab.research.google.com\/notebooks\/welcome.ipynb#recent=true\">Google CoLab <\/a>, there you also have the possibility to use a GPU and even for free. <\/p>\n\n\n\n<p>Activate GPU or TPU in notebook <\/p>\n\n\n\n<p>By default the notebook runs on the CPU. If you want to run the calculations faster, you have to activate the hardware acceleration first. <\/p>\n\n\n\n<p><\/p>\n\n\n\n\r<div class=\"GARD gard_advanced_mode\" id=\"google-ads-Vxfl\"><script>\radUnit = document.getElementById(\"google-ads-Vxfl\");\rgoogle_ad_client = \"ca-pub-2912967267075159\";\radUnit = document.getElementById(\"google-ads-Vxfl\");\radWidth = adUnit.offsetWidth;\rif ( adWidth >= 999999 ) {\r\/* GETTING THE FIRST IF OUT OF THE WAY *\/ \r} else if ( adWidth >= 468 ) {\rif (document.querySelectorAll(\".ad_unit\").length > 3 ) {\rgoogle_ad_slot = \"0\";\radUnit.style.display = \"none\";\r} else {\rgoogle_ad_slot = \"9924945823\";\rgoogle_ad_width = 468;\rgoogle_ad_height = 60;\radUnit.style.cssFloat  = \"\";\radUnit.style.styleFloat  = \"\";\radUnit.style.margin = \"\";\radUnit.style.textAlign = \"\";\radcount = document.querySelectorAll(\".ad_unit\").length;\rtag = \"ad_unit_468x60_\"+adcount;\radUnit.className = adUnit.className + \" ad_unit \" + tag;\r}\r} else if ( adWidth >= 300 ) {\rif (document.querySelectorAll(\".large_skyscraper\").length > 3 ) {\rgoogle_ad_slot = \"0\";\radUnit.style.display = \"none\";\r} else {\rgoogle_ad_slot = \"8448212620\";\rgoogle_ad_width = 300;\rgoogle_ad_height = 600;\radUnit.style.cssFloat  = \"\";\radUnit.style.styleFloat  = \"\";\radUnit.style.margin = \"\";\radUnit.style.textAlign = \"\";\radcount = document.querySelectorAll(\".large_skyscraper\").length;\rtag = \"large_skyscraper_300x600_\"+adcount;\radUnit.className = adUnit.className + \" large_skyscraper \" + tag;\r}\r} else if ( adWidth >= 160 ) {\rif (document.querySelectorAll(\".ad_unit\").length > 3 ) {\rgoogle_ad_slot = \"0\";\radUnit.style.display = \"none\";\r} else {\rgoogle_ad_slot = \"7793371424\";\rgoogle_ad_width = 160;\rgoogle_ad_height = 600;\radUnit.style.cssFloat  = \"\";\radUnit.style.styleFloat  = \"\";\radUnit.style.margin = \"\";\radUnit.style.textAlign = \"\";\radcount = document.querySelectorAll(\".ad_unit\").length;\rtag = \"ad_unit_160x600_\"+adcount;\radUnit.className = adUnit.className + \" ad_unit \" + tag;\r}\r} else {\rgoogle_ad_slot = \"0\";\radUnit.style.display = \"none\";\r}<\/script>\r<script src=\"\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\"><\/script><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>If you have a notebook open, you have to click on &#8220;Runtime&#8221; in the menu and then on &#8220;Change runtime type&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"679\" height=\"484\" src=\"http:\/\/ideee.3deee.ch\/wp-content\/uploads\/2019\/01\/2019-01-15_21h15_50.png\" alt=\"\" class=\"wp-image-958\" srcset=\"https:\/\/ideee.3deee.ch\/wp-content\/uploads\/2019\/01\/2019-01-15_21h15_50.png 679w, https:\/\/ideee.3deee.ch\/wp-content\/uploads\/2019\/01\/2019-01-15_21h15_50-300x214.png 300w\" sizes=\"(max-width: 679px) 100vw, 679px\" \/><\/figure>\n\n\n\n<p>A popup opens where you can choose if you want to use a GPU or a TPU for this notebook.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"461\" height=\"362\" src=\"http:\/\/ideee.3deee.ch\/wp-content\/uploads\/2019\/01\/2019-01-15_21h15_58.png\" alt=\"\" class=\"wp-image-959\" srcset=\"https:\/\/ideee.3deee.ch\/wp-content\/uploads\/2019\/01\/2019-01-15_21h15_58.png 461w, https:\/\/ideee.3deee.ch\/wp-content\/uploads\/2019\/01\/2019-01-15_21h15_58-300x236.png 300w\" sizes=\"(max-width: 461px) 100vw, 461px\" \/><\/figure>\n\n\n\n<p>Now you can load your Keras or Tensorflow models and run them much faster. <\/p>\n\n\n\n<p><\/p>\n\n\n\n\r<div class=\"GARD gard_advanced_mode\" id=\"google-ads-5GyP\"><script>\radUnit = document.getElementById(\"google-ads-5GyP\");\rgoogle_ad_client = \"ca-pub-2912967267075159\";\radUnit = document.getElementById(\"google-ads-5GyP\");\radWidth = adUnit.offsetWidth;\rif ( adWidth >= 999999 ) {\r\/* GETTING THE FIRST IF OUT OF THE WAY *\/ \r} else if ( adWidth >= 468 ) {\rif (document.querySelectorAll(\".ad_unit\").length > 3 ) {\rgoogle_ad_slot = \"0\";\radUnit.style.display = \"none\";\r} else {\rgoogle_ad_slot = \"9924945823\";\rgoogle_ad_width = 468;\rgoogle_ad_height = 60;\radUnit.style.cssFloat  = \"\";\radUnit.style.styleFloat  = \"\";\radUnit.style.margin = \"\";\radUnit.style.textAlign = \"\";\radcount = document.querySelectorAll(\".ad_unit\").length;\rtag = \"ad_unit_468x60_\"+adcount;\radUnit.className = adUnit.className + \" ad_unit \" + tag;\r}\r} else if ( adWidth >= 300 ) {\rif (document.querySelectorAll(\".large_skyscraper\").length > 3 ) {\rgoogle_ad_slot = \"0\";\radUnit.style.display = \"none\";\r} else {\rgoogle_ad_slot = \"8448212620\";\rgoogle_ad_width = 300;\rgoogle_ad_height = 600;\radUnit.style.cssFloat  = \"\";\radUnit.style.styleFloat  = \"\";\radUnit.style.margin = \"\";\radUnit.style.textAlign = \"\";\radcount = document.querySelectorAll(\".large_skyscraper\").length;\rtag = \"large_skyscraper_300x600_\"+adcount;\radUnit.className = adUnit.className + \" large_skyscraper \" + tag;\r}\r} else if ( adWidth >= 160 ) {\rif (document.querySelectorAll(\".ad_unit\").length > 3 ) {\rgoogle_ad_slot = \"0\";\radUnit.style.display = \"none\";\r} else {\rgoogle_ad_slot = \"7793371424\";\rgoogle_ad_width = 160;\rgoogle_ad_height = 600;\radUnit.style.cssFloat  = \"\";\radUnit.style.styleFloat  = \"\";\radUnit.style.margin = \"\";\radUnit.style.textAlign = \"\";\radcount = document.querySelectorAll(\".ad_unit\").length;\rtag = \"ad_unit_160x600_\"+adcount;\radUnit.className = adUnit.className + \" ad_unit \" + tag;\r}\r} else {\rgoogle_ad_slot = \"0\";\radUnit.style.display = \"none\";\r}<\/script>\r<script src=\"\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\"><\/script><\/div>\n","protected":false},"excerpt":{"rendered":"<p>If you just want to test a deep learning model quickly, you can use the online tool Google CoLab , there you also have the possibility to use a GPU and even for free. Activate GPU or TPU in notebook By default the notebook runs on the CPU. If you&#8230;<\/p>\n","protected":false},"author":2,"featured_media":978,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_links_to":"","_links_to_target":""},"categories":[45,46],"tags":[133,130,131,132,134],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ideee.3deee.ch\/index.php?rest_route=\/wp\/v2\/posts\/957"}],"collection":[{"href":"https:\/\/ideee.3deee.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ideee.3deee.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ideee.3deee.ch\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ideee.3deee.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=957"}],"version-history":[{"count":1,"href":"https:\/\/ideee.3deee.ch\/index.php?rest_route=\/wp\/v2\/posts\/957\/revisions"}],"predecessor-version":[{"id":960,"href":"https:\/\/ideee.3deee.ch\/index.php?rest_route=\/wp\/v2\/posts\/957\/revisions\/960"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ideee.3deee.ch\/index.php?rest_route=\/wp\/v2\/media\/978"}],"wp:attachment":[{"href":"https:\/\/ideee.3deee.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ideee.3deee.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ideee.3deee.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}