{"id":1201,"date":"2021-06-01T00:17:03","date_gmt":"2021-05-31T15:17:03","guid":{"rendered":"https:\/\/www.typea.info\/blog\/?p=1201"},"modified":"2021-06-01T00:17:03","modified_gmt":"2021-05-31T15:17:03","slug":"vscode_docker_tensorflow_dev","status":"publish","type":"post","link":"https:\/\/www.typea.info\/blog\/index.php\/2021\/06\/01\/vscode_docker_tensorflow_dev\/","title":{"rendered":"Visual Studio Code \u3067 Docker Desktop(Mac)\u306eTensorflow\u30b3\u30f3\u30c6\u30ca\u306e\u958b\u767a\u74b0\u5883\u3092\u69cb\u7bc9(\u30b0\u30e9\u30d5\u8868\u793a\u3001\u30b3\u30fc\u30c9\u88dc\u5b8c)\u624b\u9806"},"content":{"rendered":"<p><a href=\"https:\/\/amzn.to\/3bQ88Pv\">TensorFlow\u3067\u5b66\u3076\u6a5f\u68b0\u5b66\u7fd2\u30fb\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af<\/a>\u306a\u308b\u66f8\u7c4d\u3092\u8cfc\u5165\u3057\u3001\u691c\u8a3c\u74b0\u5883\u3068\u3057\u3066<a href=\"https:\/\/www.typea.info\/blog\/index.php\/2021\/05\/24\/ubunt_docker_tensorflow_other_host_bridge\/\">TensorFlow Docker\u30a4\u30e1\u30fc\u30b8\u3092Ubuntu\u306b\u69cb\u7bc9\u3057\u4ed6\u30db\u30b9\u30c8\u304b\u3089\u63a5\u7d9a\u3059\u308b<\/a>\u3088\u3046\u306b\u3057\u305f\u3002<\/p>\n<p>\u305d\u308c\u306f\u305d\u308c\u3068\u3057\u3066\u3001Jupyter notebook \u3067\u30b3\u30fc\u30c9\u66f8\u304f\u3088\u308a\u3001VSCode\u3067\u66f8\u3044\u305f\u307b\u3046\u304c\u6357\u308b\u306e\u304b\u306a\u3068\u3044\u3046\u601d\u3044\u3082\u3042\u308a\u3001Docker\u30b3\u30f3\u30c6\u30ca\u306bopenssh\u30b5\u30fc\u30d0\u30fc\u5165\u308c\u3066\u3001<a href=\"https:\/\/www.typea.info\/tips_\/index.php\/Visual_Studio_Code#Remote_SSH\">Visual Studio Code \u304b\u3089\u30ea\u30e2\u30fc\u30c8\u306bSSH\u7d4c\u7531\u3067\u63a5\u7d9a\u3059\u308b\u30d7\u30e9\u30b0\u30a4\u30f3<\/a>\u3067\u63a5\u7d9a\u3059\u308c\u3070\u3088\u3044\u304b\u306a\u306a\u3069\u3068\u4e00\u77ac\u8003\u3048\u305f\u3051\u3069\u3001\u3061\u3087\u3063\u3068\u9055\u548c\u611f\u3042\u308a\u3002VSCode\u306a\u3089\u3001Docker\u306e\u30b3\u30f3\u30c6\u30ca\u306b\u76f4\u63a5\u63a5\u7d9a\u3059\u308b\u62e1\u5f35\u304f\u3089\u3044\u3042\u308a\u305d\u3046\u3060\u3068\u5c11\u3057\u3057\u3089\u3079\u3089\u3089\u3001\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<h2>1.Visual Studio Code\u3092Dcoker\u30b3\u30f3\u30c6\u30ca\u306b\u63a5\u7d9a\u3059\u308b Remote Containers \u62e1\u5f35<\/h2>\n<p>\u3053\u3044\u3064\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"vscode_remote_container_extension.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2021\/05\/vscode_remote_container_extension.png\" alt=\"vscode_remote_container_extension\" width=\"598\" height=\"140\" border=\"0\" \/><\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304a\u308f\u308b\u3068\u3001\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u5de6\u4e0b\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30de\u30fc\u30af\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u30af\u30ea\u30c3\u30af<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"vscode_remote_container_extension_attach.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2021\/05\/vscode_remote_container_extension_attach.png\" alt=\"vscode_remote_container_extension_attach\" width=\"259\" height=\"115\" border=\"0\" \/><\/p>\n<h2>2.Mac \u306b Docker Desktop \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u30b3\u30f3\u30c6\u30ca\u3092\u52d5\u304b\u3057\u3066\u304a\u304f<\/h2>\n<p>\u3063\u3068\u3001\u30af\u30ea\u30c3\u30af\u3059\u308b\u524d\u306b\u3001<a href=\"https:\/\/docs.docker.jp\/docker-for-mac\/install.html\">Mac \u306b Docker Desktop \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a>\u3057\u3066\u3001<a href=\"https:\/\/www.tensorflow.org\/install\/docker?hl=ja\">Docker \u30b3\u30f3\u30c6\u30ca\u3068\u3057\u3066Tensorflow\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a>\u8d77\u52d5\u3057\u3066\u304a\u304f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"docker_desctop_mac.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2021\/05\/docker_desctop_mac-1.png\" alt=\"docker_desctop_mac\" width=\"599\" height=\"347\" border=\"0\" \/><\/p>\n<h2>3.\u30b3\u30f3\u30c6\u30ca\u306b\u63a5\u7d9a<\/h2>\n<p>\u518d\u5ea6\u753b\u9762\u306e\u5de6\u4e0b\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u9078\u629e\u304c\u3067\u304d\u308b\u30d7\u30eb\u30c0\u30a6\u30f3\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u300cAttach to Running Container\u300d \u3092\u9078\u629e\u3059\u308b\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"vscode_remote_container_extension_attach_container.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2021\/05\/vscode_remote_container_extension_attach_container.png\" alt=\"vscode_remote_container_extension_attach_container\" width=\"599\" height=\"342\" border=\"0\" \/><\/p>\n<p>\u8d77\u52d5\u3057\u3066\u3044\u308b\u30b3\u30f3\u30c6\u30ca\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u9078\u629e\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"vscode_remote_container_extension_attach_container2.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2021\/05\/vscode_remote_container_extension_attach_container2-1.png\" alt=\"vscode_remote_container_extension_attach_container2\" width=\"596\" height=\"150\" border=\"0\" \/><\/p>\n<p>\u63a5\u7d9a\u3055\u308c\u305f\u3002Terminarl\u3092\u8868\u793a\u3059\u308b\u3068\u3001\u30d7\u30ed\u30f3\u30d7\u30c8\u306a\u3069\u3067\u78ba\u8a8d\u3067\u304d\u308b\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"vscode_remote_container_extension_attach_tf.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2021\/05\/vscode_remote_container_extension_attach_tf-1.png\" alt=\"vscode_remote_container_extension_attach_tf\" width=\"599\" height=\"344\" border=\"0\" \/><\/p>\n<p>\u3057\u304b\u3057\u3053\u308c\u306f\u4fbf\u5229\u3059\u304e\u308b\u3002<\/p>\n<p>\u4e00\u6642\u7684\u306a\u958b\u767a\u74b0\u5883\u306f\u3001Mac \u306eDocker Desktop \u306e\u30b3\u30f3\u30c6\u30ca\u3068\u3057\u3066\u69cb\u7bc9\u3059\u308c\u3070\u74b0\u5883\u3092\u6c5a\u3055\u305a\u306b\u3059\u3080\u3057\u3001\u63d0\u4f9b\u3055\u308c\u308c\u3066\u3044\u308b\u30b3\u30f3\u30c6\u30ca\u30a4\u30e1\u30fc\u30b8\u304c\u4f7f\u3048\u308c\u3070\u74b0\u5883\u69cb\u7bc9\u3082\u4e0d\u8981\u3058\u3083\u306a\u3044\u304b\u3002<\/p>\n<h2>4.\u8a66\u3057\u306b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3068\u30b0\u30e9\u30d5<\/h2>\n<p><a href=\"https:\/\/www.amazon.co.jp\/TensorFlow%E6%A9%9F%E6%A2%B0%E5%AD%A6%E7%BF%92%E3%82%AF%E3%83%83%E3%82%AF%E3%83%96%E3%83%83%E3%82%AF-Python%E3%83%99%E3%83%BC%E3%82%B9%E3%81%AE%E6%B4%BB%E7%94%A8%E3%83%AC%E3%82%B7%E3%83%9460-impress-top-gear\/dp\/4295002003?__mk_ja_JP=%E3%82%AB%E3%82%BF%E3%82%AB%E3%83%8A&amp;dchild=1&amp;keywords=Tensorflow&amp;qid=1622473039&amp;sr=8-15&amp;linkCode=li2&amp;tag=typea09-22&amp;linkId=8594123dfea339b58eed2bb81656ca27&amp;language=ja_JP&amp;ref_=as_li_ss_il\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"\/\/ws-fe.amazon-adsystem.com\/widgets\/q?_encoding=UTF8&amp;ASIN=4295002003&amp;Format=_SL160_&amp;ID=AsinImage&amp;MarketPlace=JP&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=typea09-22&amp;language=ja_JP\" border=\"0\" \/><\/a><img loading=\"lazy\" decoding=\"async\" style=\"border: none !important; margin: 0px !important;\" src=\"https:\/\/ir-jp.amazon-adsystem.com\/e\/ir?t=typea09-22&amp;language=ja_JP&amp;l=li2&amp;o=9&amp;a=4295002003\" alt=\"\" width=\"1\" height=\"1\" border=\"0\" \/><\/p>\n<p>\u00a0<\/p>\n<p>\u3042\u3068\u3001\u30b0\u30e9\u30d5\u3092\u51fa\u3057\u3066\u307f\u308b\u3002<\/p>\n<p><a href=\"https:\/\/www.tensorflow.org\/install\/docker?hl=ja\">Tensorflow\u306eDocker\u30a4\u30e1\u30fc\u30b8<\/a>\u306b\u306f\u3001matplotlib \u307b\u304b\u3001\u5fc5\u8981\u306a\u3082\u306e\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u3002<\/p>\n<h3>4.1 \u30b0\u30e9\u30d5\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u51fa\u529b<\/h3>\n<p>savefig() \u3067\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u51fa\u3057\u3066\u307f\u308b\u3002<\/p>\n<pre class=\"prettyprint\">from pylab import *\nfrom numpy import *\nx = arange(\u20133,3,.1)\ny = [y1**3 for y1 in x]\nplot(x,y)\nplt.savefig(\u201c\/root\/workspaces\/tf\/fig.png\u201d)<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"vscode_remote_container_extension_attach_tf_python_run.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2021\/05\/vscode_remote_container_extension_attach_tf_python_run-1.png\" alt=\"vscode_remote_container_extension_attach_tf_python_run\" width=\"598\" height=\"341\" border=\"0\" \/><\/p>\n<h3>4.2 \u30b0\u30e9\u30d5\u3092\u30d6\u30e9\u30a6\u30b6\u306b\u51fa\u529b<\/h3>\n<p>use(\u201cWebAgg\u201d) \u3068\u3057\u3066\u3001show()\u3000\u3059\u308b\u3068\u3001\u30d6\u30e9\u30a6\u30b6\u304c\u7acb\u3061\u4e0a\u304c\u308a\u305d\u3061\u3089\u306b\u30b0\u30e9\u30d5\u304c\u63cf\u753b\u3055\u308c\u308b<\/p>\n<pre class=\"prettyprint\">import matplotlib\nmatplotlib.use(\u201cWebAgg\u201d)\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport random\nfig,ax = plt.subplots()\nax.bar(np.arange(10),[random.randrange(0,10) for x in range(10)],1)\nplt.show()\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"vscode_container_py_graph.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2021\/05\/vscode_container_py_graph.png\" alt=\"vscode_container_py_graph\" width=\"477\" height=\"447\" border=\"0\" \/><\/p>\n<h3>4.3 \u30b0\u30e9\u30d5\u3092VSCode\u306b\u51fa\u529b<\/h3>\n<p>\u753b\u9762\u6700\u4e0b\u6bb5\u306e\u30a2\u30a4\u30b3\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001\u30dd\u30fc\u30c8\u30de\u30c3\u30d4\u30f3\u30b0\u306e\u4e00\u89a7\u3092\u8868\u793a\u3001VSCode\u306eWeb\u30d3\u30e5\u30fc\u306b\u8868\u793a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"vs_container_py_graph2.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2021\/05\/vs_container_py_graph2.png\" alt=\"vs_container_py_graph2\" width=\"599\" height=\"345\" border=\"0\" \/><\/p>\n<h2>5.Python\u30b3\u30fc\u30c9\u88dc\u5b8c<\/h2>\n<p>\u3042\u3068\u3001jupyter notebook \u3060\u3068\u30b3\u30fc\u30c9\u88dc\u5b8c\u304c\u52b9\u304b\u306a\u3044\u306e\u304c\u3084\u306f\u308a\u7269\u8db3\u308a\u306a\u3044\u3002<\/p>\n<p>Python Language Server \u306e\u8a2d\u5b9a\u3092 Microsoft\u306b\u5909\u66f4<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"vscode_pythob_language_server.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2021\/05\/vscode_pythob_language_server.png\" alt=\"vscode_pythob_language_server\" width=\"598\" height=\"251\" border=\"0\" \/><\/p>\n<p>VSCode\u4e0a\u3067\u30b3\u30fc\u30c9\u88dc\u5b8cOK<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"vscode_python_suggest.png\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2021\/05\/vscode_python_suggest.png\" alt=\"vscode_python_suggest\" width=\"599\" height=\"349\" border=\"0\" \/><\/p>\n<p>\u306a\u304b\u306a\u304b\u5b66\u3073\u304c\u591a\u304b\u3063\u305f\u306a\u3002<\/p>\n<p><iframe style=\"width: 120px; height: 240px;\" src=\"https:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?ref=qf_sp_asin_til&amp;t=typea09-22&amp;m=amazon&amp;o=9&amp;p=8&amp;l=as1&amp;IS2=1&amp;detail=1&amp;asins=B08LYWFPQ9&amp;linkId=0b9fd06ee87ae70fb4d0f51dbc0cab25&amp;bc1=ffffff&amp;lt1=_top&amp;fc1=333333&amp;lc1=0066c0&amp;bg1=ffffff&amp;f=ifr\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><br \/>\n    <\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>TensorFlow\u3067\u5b66\u3076\u6a5f\u68b0\u5b66\u7fd2\u30fb\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306a\u308b\u66f8\u7c4d\u3092\u8cfc\u5165\u3057\u3001\u691c\u8a3c\u74b0\u5883\u3068\u3057\u3066TensorFlow Docker\u30a4\u30e1\u30fc\u30b8\u3092Ubuntu\u306b\u69cb\u7bc9\u3057\u4ed6\u30db\u30b9\u30c8\u304b\u3089\u63a5\u7d9a\u3059\u308b\u3088\u3046\u306b\u3057\u305f\u3002 \u305d\u308c\u306f\u305d\u308c\u3068\u3057\u3066\u3001Jupyter [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1203,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","footnotes":""},"categories":[75,151,96],"tags":[152,154,155],"class_list":["post-1201","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker","category-tensofflow","category-visual-studio-code","tag-docker","tag-tensorflow","tag-visual-studio-code"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1201"}],"version-history":[{"count":2,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1201\/revisions"}],"predecessor-version":[{"id":1204,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1201\/revisions\/1204"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media\/1203"}],"wp:attachment":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}