tek4

Giới Thiệu Về Jupyter Notebook – Tự Học TensorFlow

by - September. 21, 2021
Học
<blockquote> <p style="text-align: justify;">Ch&agrave;o mừng c&aacute;c bạn quay trở lại với loạt b&agrave;i&nbsp;<a href="../../tu-hoc-tensorflow-deep-learning-cho-nguoi-moi-bat-dau/" target="_blank" rel="noopener">Tự Học Tensorflow</a>&nbsp;của&nbsp;<a href="../../" target="_blank" rel="noopener">tek4.vn</a>.&nbsp;B&agrave;i viết n&agrave;y sẽ&nbsp;giới thiệu đến c&aacute;c bạn về&nbsp;Jupyter notebook v&agrave;&nbsp;c&aacute;ch sử dụng với AWS. Bắt đầu th&ocirc;i!</p> </blockquote> <p style="text-align: justify;">Xem th&ecirc;m b&agrave;i viết trước:&nbsp;<a href="../../cai-dat-tensorflow-cho-windows-va-mac-tu-hoc-tensorflow/" target="_blank" rel="noopener">C&agrave;i đặt Tensorflow cho Windows v&agrave; Mac</a></p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7348 disappear appear" src="../../wp-content/uploads/2021/01/4.png" sizes="(max-width: 1114px) 100vw, 1114px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/4.png 1114w, https://old.tek4.vn/wp-content/uploads/2021/01/4-300x156.png 300w, https://old.tek4.vn/wp-content/uploads/2021/01/4-1024x534.png 1024w, https://old.tek4.vn/wp-content/uploads/2021/01/4-768x401.png 768w" alt="Jupyter Notebook" width="1114" height="581" loading="lazy" /></p> <h3 id="ftoc-heading-1" class="ftwp-heading" style="text-align: justify;">Jupyter Notebook l&agrave; g&igrave;</h3> <p style="text-align: justify;">Jupyter notebook &agrave; một ứng dụng web cho ph&eacute;p người d&ugrave;ng viết code v&agrave; c&aacute;c phần tử văn bản đa dạng thức. B&ecirc;n trong Notebooks, bạn c&oacute; thể viết đoạn văn, phương tr&igrave;nh, ti&ecirc;u đề, th&ecirc;m li&ecirc;n kết, số liệu, v.v. Jupyter notebook cũng l&agrave; một c&aacute;ch thuận tiện để chạy ph&acirc;n t&iacute;ch dữ liệu.</p> <h3 id="ftoc-heading-2" class="ftwp-heading" style="text-align: justify;">Giới thiệu về ứng dụng Jupyter Notebook</h3> <p style="text-align: justify;">Ứng dụng Jupyter Notebook l&agrave; giao diện nơi bạn c&oacute; thể viết c&aacute;c tập lệnh v&agrave; code th&ocirc;ng qua tr&igrave;nh duyệt web của m&igrave;nh. Ứng dụng c&oacute; thể được sử dụng cục bộ, c&oacute; nghĩa l&agrave; bạn kh&ocirc;ng cần truy cập internet hoặc m&aacute;y chủ từ xa.</p> <p style="text-align: justify;"><img class="aligncenter disappear appear" src="https://www.guru99.com/images/1/080418_1223_WhatisJupyt1.png" /></p> <p style="text-align: justify;">Mỗi t&iacute;nh to&aacute;n được thực hiện th&ocirc;ng qua một kernel. Một kernel mới được tạo mỗi khi bạn khởi chạy Jupyter.</p> <h3 id="ftoc-heading-3" class="ftwp-heading" style="text-align: justify;">C&aacute;ch sử dụng Notebook</h3> <p style="text-align: justify;">ch&uacute;ng ta sẽ viết một d&ograve;ng code đơn giản để l&agrave;m quen với m&ocirc;i trường của Jupyter.</p> <p style="text-align: justify;"><strong>Bước 1)</strong>&nbsp;Bạn th&ecirc;m một thư mục b&ecirc;n trong thư mục l&agrave;m việc chứa tất cả c&aacute;c notebooks bạn sẽ tạo trong c&aacute;c b&agrave;i hướng dẫn về TensorFlow.</p> <p style="text-align: justify;">Mở Terminal v&agrave; viết:</p> <div id="urvanov-syntax-highlighter-610fe806321e4581490373" class="urvanov-syntax-highlighter-syntax crayon-theme-classic urvanov-syntax-highlighter-font-monaco urvanov-syntax-highlighter-os-pc print-yes notranslate" style="text-align: justify;" data-settings=" minimize scroll-mouseover"> <div class="urvanov-syntax-highlighter-plain-wrap">&nbsp;</div> <div class="urvanov-syntax-highlighter-main"> <table class="crayon-table"> <tbody> <tr class="urvanov-syntax-highlighter-row"> <td class="crayon-nums " data-settings="show"> <div class="urvanov-syntax-highlighter-nums-content"> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe806321e4581490373-1">1</div> <div class="crayon-num crayon-striped-num" data-line="urvanov-syntax-highlighter-610fe806321e4581490373-2">2</div> </div> </td> <td class="urvanov-syntax-highlighter-code"> <div class="crayon-pre"> <div id="urvanov-syntax-highlighter-610fe806321e4581490373-1" class="crayon-line"><span class="crayon-e">mkdir </span><span class="crayon-e">jupyter_tf</span></div> <div id="urvanov-syntax-highlighter-610fe806321e4581490373-2" class="crayon-line crayon-striped-line"><span class="crayon-e">jupyter </span><span class="crayon-v">notebook</span></div> </div> </td> </tr> </tbody> </table> </div> </div> <p style="text-align: justify;">Giải th&iacute;ch:</p> <ul style="text-align: justify;"> <li>mkdir jupyter_tf: Tạo t&ecirc;n thư mục jupyter_tf</li> <li>jupyter notebook:&nbsp; Mở ứng dụng web Jupyter</li> </ul> <p style="text-align: justify;">Bước 2) Bạn c&oacute; thể thấy thư mục mới b&ecirc;n trong m&ocirc;i trường. Nhấp v&agrave;o thư mục jupyter_tf.</p> <p style="text-align: justify;"><img class="aligncenter disappear appear" src="https://www.guru99.com/images/1/080418_1223_WhatisJupyt3.png" /></p> <p style="text-align: justify;">Bước 3) B&ecirc;n trong thư mục n&agrave;y, bạn sẽ tạo notebook đầu ti&ecirc;n của m&igrave;nh. Nhấp v&agrave;o n&uacute;t New v&agrave; Python 3.</p> <p style="text-align: justify;"><img class="aligncenter disappear appear" src="https://www.guru99.com/images/1/080418_1223_WhatisJupyt4.png" /></p> <p style="text-align: justify;"><strong>Bước 4)</strong>&nbsp;Bạn đang ở b&ecirc;n trong m&ocirc;i trường Jupyter. Cho đến nay, notebook của bạn được gọi l&agrave; Untiltled.ipynb. Đ&acirc;y l&agrave; t&ecirc;n mặc định do Jupyter đưa ra. H&atilde;y đổi t&ecirc;n n&oacute; bằng c&aacute;ch nhấp v&agrave;o &nbsp;<strong>File</strong>&nbsp;v&agrave;&nbsp;<strong>Rename.</strong></p> <p style="text-align: justify;"><img class="aligncenter disappear appear" src="https://www.guru99.com/images/1/080418_1223_WhatisJupyt5.png" /></p> <p style="text-align: justify;">Bạn c&oacute; thể đổi t&ecirc;n n&oacute; l&agrave; Introduction_jupyter.</p> <p style="text-align: justify;"><img class="aligncenter disappear appear" src="https://www.guru99.com/images/1/080418_1223_WhatisJupyt6.png" /></p> <p style="text-align: justify;">Trong Jupyter notebook, bạn viết code, ch&uacute; th&iacute;ch hoặc văn bản b&ecirc;n trong c&aacute;c &ocirc;.</p> <p style="text-align: justify;">B&ecirc;n trong một &ocirc;, bạn c&oacute; thể viết một d&ograve;ng code.</p> <p style="text-align: justify;"><img class="aligncenter disappear appear" src="https://www.guru99.com/images/1/080418_1223_WhatisJupyt8.png" /></p> <p style="text-align: justify;">Hoặc nhiều d&ograve;ng. Jupyter đọc code hết d&ograve;ng n&agrave;y đến d&ograve;ng kh&aacute;c.</p> <p style="text-align: justify;"><img class="aligncenter disappear appear" src="https://www.guru99.com/images/1/080418_1223_WhatisJupyt9.png" /></p> <p style="text-align: justify;">V&iacute; dụ: nếu bạn viết code sau b&ecirc;n trong một &ocirc;.</p> <p style="text-align: justify;"><img class="aligncenter disappear appear" src="https://www.guru99.com/images/1/080418_1223_WhatisJupyt10.png" /></p> <p style="text-align: justify;">N&oacute; sẽ tạo ra đầu ra n&agrave;y.</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7586 disappear appear" src="../../wp-content/uploads/2021/01/Capture-82.png" sizes="(max-width: 447px) 100vw, 447px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/Capture-82.png 447w, https://old.tek4.vn/wp-content/uploads/2021/01/Capture-82-300x142.png 300w" alt="" width="447" height="212" loading="lazy" /></p> <p style="text-align: justify;">Bước 5) Bạn đ&atilde; sẵn s&agrave;ng để viết d&ograve;ng code đầu ti&ecirc;n của m&igrave;nh. Bạn c&oacute; thể nhận thấy &ocirc; c&oacute; hai m&agrave;u. M&agrave;u xanh lục c&oacute; nghĩa l&agrave; bạn đang ở chế độ chỉnh sửa (<strong>editing mode</strong>). Tuy nhi&ecirc;n, m&agrave;u xanh lam cho biết bạn đang ở chế độ thực thi (<strong>executing mode</strong>).</p> <p style="text-align: justify;">D&ograve;ng code đầu ti&ecirc;n của bạn sẽ l&agrave; in TEK4VN. B&ecirc;n trong &ocirc;, bạn c&oacute; thể viết:</p> <div id="urvanov-syntax-highlighter-610fe806321f3405810255" class="urvanov-syntax-highlighter-syntax crayon-theme-classic urvanov-syntax-highlighter-font-monaco urvanov-syntax-highlighter-os-pc print-yes notranslate" style="text-align: justify;" data-settings=" minimize scroll-mouseover"> <div class="urvanov-syntax-highlighter-plain-wrap">&nbsp;</div> <div class="urvanov-syntax-highlighter-main"> <table class="crayon-table"> <tbody> <tr class="urvanov-syntax-highlighter-row"> <td class="crayon-nums " data-settings="show"> <div class="urvanov-syntax-highlighter-nums-content"> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe806321f3405810255-1">1</div> </div> </td> <td class="urvanov-syntax-highlighter-code"> <div class="crayon-pre"> <div id="urvanov-syntax-highlighter-610fe806321f3405810255-1" class="crayon-line"><span class="crayon-e">print</span><span class="crayon-sy">(</span><span class="crayon-s">"TEK4VN!"</span><span class="crayon-sy">)</span></div> </div> </td> </tr> </tbody> </table> </div> </div> <p style="text-align: justify;">C&oacute; hai c&aacute;ch để chạy code trong Jupyter:</p> <ul style="text-align: justify;"> <li><strong>Click v&agrave; Run</strong></li> <li><strong>C&aacute;c ph&iacute;m tắt b&agrave;n ph&iacute;m</strong></li> </ul> <p style="text-align: justify;">Để chạy code, bạn c&oacute; thể nhấp v&agrave;o Cell, sau đ&oacute; nhấp v&agrave;o Run v&agrave;&nbsp;<strong>Run Cells and Select Below:</strong></p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7587 disappear appear" src="../../wp-content/uploads/2021/01/080418_1223_WhatisJupyt14.png" sizes="(max-width: 652px) 100vw, 652px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080418_1223_WhatisJupyt14.png 652w, https://old.tek4.vn/wp-content/uploads/2021/01/080418_1223_WhatisJupyt14-300x196.png 300w, https://old.tek4.vn/wp-content/uploads/2021/01/080418_1223_WhatisJupyt14-90x60.png 90w" alt="" width="652" height="425" loading="lazy" /></p> <p style="text-align: justify;">Bạn c&oacute; thể thấy code được in b&ecirc;n dưới &ocirc; v&agrave; một &ocirc; mới đ&atilde; xuất hiện ngay sau đầu ra.</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7588 disappear appear" src="../../wp-content/uploads/2021/01/Capture-83.png" sizes="(max-width: 479px) 100vw, 479px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/Capture-83.png 479w, https://old.tek4.vn/wp-content/uploads/2021/01/Capture-83-300x47.png 300w, https://old.tek4.vn/wp-content/uploads/2021/01/Capture-83-475x75.png 475w" alt="" width="479" height="75" loading="lazy" /></p> <p style="text-align: justify;">C&aacute;ch nhanh hơn để chạy m&atilde; l&agrave; sử dụng Ph&iacute;m tắt. Để truy cập Ph&iacute;m tắt, h&atilde;y đi tới&nbsp;<strong>Help</strong>&nbsp;v&agrave;&nbsp;<strong>Keyboard Shortcuts</strong></p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7589 disappear appear" src="../../wp-content/uploads/2021/01/080418_1223_WhatisJupyt16.png" alt="" width="295" height="181" loading="lazy" /></p> <p style="text-align: justify;">B&ecirc;n dưới danh s&aacute;ch c&aacute;c ph&iacute;m tắt cho b&agrave;n ph&iacute;m MacOS. Bạn c&oacute; thể chỉnh sửa c&aacute;c ph&iacute;m tắt trong tr&igrave;nh chỉnh sửa.</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7591 disappear appear" src="../../wp-content/uploads/2021/01/080418_1223_WhatisJupyt17.png" sizes="(max-width: 919px) 100vw, 919px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080418_1223_WhatisJupyt17.png 919w, https://old.tek4.vn/wp-content/uploads/2021/01/080418_1223_WhatisJupyt17-300x121.png 300w, https://old.tek4.vn/wp-content/uploads/2021/01/080418_1223_WhatisJupyt17-768x310.png 768w" alt="" width="919" height="371" loading="lazy" /></p> <p style="text-align: justify;">Sau đ&acirc;y l&agrave; c&aacute;c ph&iacute;m tắt d&agrave;nh cho Windows</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7590 disappear appear" src="../../wp-content/uploads/2021/01/080418_1223_WhatisJupyt18.png" sizes="(max-width: 653px) 100vw, 653px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080418_1223_WhatisJupyt18.png 653w, https://old.tek4.vn/wp-content/uploads/2021/01/080418_1223_WhatisJupyt18-300x119.png 300w" alt="" width="653" height="260" loading="lazy" />Viết d&ograve;ng n&agrave;y:</p> <div id="urvanov-syntax-highlighter-610fe806321fa920438384" class="urvanov-syntax-highlighter-syntax crayon-theme-classic urvanov-syntax-highlighter-font-monaco urvanov-syntax-highlighter-os-pc print-yes notranslate" style="text-align: justify;" data-settings=" minimize scroll-mouseover"> <div class="urvanov-syntax-highlighter-plain-wrap">&nbsp;</div> <div class="urvanov-syntax-highlighter-main"> <table class="crayon-table"> <tbody> <tr class="urvanov-syntax-highlighter-row"> <td class="crayon-nums " data-settings="show"> <div class="urvanov-syntax-highlighter-nums-content"> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe806321fa920438384-1">1</div> </div> </td> <td class="urvanov-syntax-highlighter-code"> <div class="crayon-pre"> <div id="urvanov-syntax-highlighter-610fe806321fa920438384-1" class="crayon-line"><span class="crayon-e">print</span><span class="crayon-sy">(</span><span class="crayon-s">"Hello world!"</span><span class="crayon-sy">)</span></div> </div> </td> </tr> </tbody> </table> </div> </div> <p style="text-align: justify;">V&agrave; cố gắng sử dụng ph&iacute;m tắt để chạy code. Sử dụng shift + enter. N&oacute; sẽ thực thi &ocirc; v&agrave; ch&egrave;n một &ocirc; trống mới b&ecirc;n dưới, giống như bạn đ&atilde; l&agrave;m trước đ&acirc;y.</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7592 disappear appear" src="../../wp-content/uploads/2021/01/Capture-84.png" sizes="(max-width: 429px) 100vw, 429px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/Capture-84.png 429w, https://old.tek4.vn/wp-content/uploads/2021/01/Capture-84-300x100.png 300w" alt="" width="429" height="143" loading="lazy" /></p> <p style="text-align: justify;">Bước 6) Đ&atilde; đến l&uacute;c đ&oacute;ng Notebook. Đi tới File v&agrave; nhấp v&agrave;o &nbsp;<strong>Close and Halt</strong></p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7593 disappear appear" src="../../wp-content/uploads/2021/01/080418_1223_WhatisJupyt20.png" sizes="(max-width: 231px) 100vw, 231px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080418_1223_WhatisJupyt20.png 231w, https://old.tek4.vn/wp-content/uploads/2021/01/080418_1223_WhatisJupyt20-147x300.png 147w" alt="" width="231" height="472" loading="lazy" /></p> <p style="text-align: justify;">Lưu &yacute;: Jupyter tự động lưu notebook với checkpoint. Nếu bạn c&oacute; th&ocirc;ng b&aacute;o sau:</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7594 disappear appear" src="../../wp-content/uploads/2021/01/Capture-85.png" sizes="(max-width: 571px) 100vw, 571px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/Capture-85.png 571w, https://old.tek4.vn/wp-content/uploads/2021/01/Capture-85-300x157.png 300w" alt="" width="571" height="299" loading="lazy" /></p> <p style="text-align: justify;">N&oacute; c&oacute; nghĩa l&agrave; Jupyter đ&atilde; kh&ocirc;ng lưu tệp kể từ lần kiểm tra cuối c&ugrave;ng. Bạn c&oacute; thể lưu sổ tay theo c&aacute;ch thủ c&ocirc;ng.</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7595 disappear appear" src="../../wp-content/uploads/2021/01/Capture-86.png" sizes="(max-width: 614px) 100vw, 614px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/Capture-86.png 614w, https://old.tek4.vn/wp-content/uploads/2021/01/Capture-86-300x119.png 300w" alt="" width="614" height="244" loading="lazy" /></p> <p style="text-align: justify;">Bạn sẽ được chuyển hướng đến bảng điều khiển ch&iacute;nh. Bạn c&oacute; thể thấy notebook của m&igrave;nh đ&atilde; được lưu một ph&uacute;t trước.</p> <h3 id="ftoc-heading-4" class="ftwp-heading" style="text-align: justify;">C&agrave;i đặt Jupyter Notebook với AWS</h3> <p style="text-align: justify;">Nếu bạn chưa c&oacute; t&agrave;i khoản tại AWS, h&atilde;y tạo t&agrave;i khoản miễn ph&iacute;&nbsp;<a href="https://aws.amazon.com/vi/free/?all-free-tier.sort-by=item.additionalFields.SortRank&amp;all-free-tier.sort-order=asc" target="_blank" rel="noopener">tại đ&acirc;y</a>.</p> <h4 id="ftoc-heading-5" class="ftwp-heading" style="text-align: justify;">PHẦN 1: Thiết lập cặp kh&oacute;a</h4> <p style="text-align: justify;"><strong>Bước 1)</strong>&nbsp;Đi tới&nbsp;<strong>Services</strong>&nbsp;v&agrave; t&igrave;m&nbsp;<strong>EC2.</strong></p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7658 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup1.png" sizes="(max-width: 604px) 100vw, 604px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup1.png 604w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup1-300x226.png 300w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup1-45x35.png 45w" alt="" width="604" height="455" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 2)&nbsp;</strong>Trong bảng điều khiển v&agrave; nhấp v&agrave;o&nbsp;<strong>Key Pairs</strong></p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7659 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup2.png" alt="" width="212" height="195" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 3)</strong>&nbsp;Nhấp v&agrave;o Create Key Pair</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7660 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup3.png" sizes="(max-width: 377px) 100vw, 377px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup3.png 377w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup3-300x57.png 300w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup3-373x72.png 373w" alt="" width="377" height="72" loading="lazy" /></p> <ul style="text-align: justify;"> <li>Bạn c&oacute; thể gọi n&oacute; l&agrave; Docker key</li> <li>Nhấp v&agrave;o Create</li> </ul> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7661 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup4.png" sizes="(max-width: 480px) 100vw, 480px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup4.png 480w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup4-300x115.png 300w" alt="" width="480" height="184" loading="lazy" /></p> <p style="text-align: justify;">Tải xuống t&ecirc;n tệp Docker_key.pem.</p> <p style="text-align: justify;"><strong>Bước 4)</strong>&nbsp;Sao ch&eacute;p v&agrave; d&aacute;n n&oacute; v&agrave;o folder key.</p> <p style="text-align: justify;"><strong>Chỉ d&agrave;nh cho người d&ugrave;ng Mac OS</strong></p> <p style="text-align: justify;">Bước n&agrave;y chỉ li&ecirc;n quan đến người d&ugrave;ng Mac OS. Đối với người d&ugrave;ng Windows hoặc Linux, vui l&ograve;ng chuyển sang PHẦN 2</p> <p style="text-align: justify;">Bạn cần đặt một thư mục l&agrave;m việc sẽ chứa file key</p> <p style="text-align: justify;">Trước hết, h&atilde;y tạo một thư mục c&oacute; t&ecirc;n l&agrave; key. N&oacute; nằm b&ecirc;n trong thư mục ch&iacute;nh Docker. Sau đ&oacute;, bạn đặt đường dẫn n&agrave;y l&agrave;m thư mục l&agrave;m việc của m&igrave;nh.</p> <div id="urvanov-syntax-highlighter-610fe80632200823148744" class="urvanov-syntax-highlighter-syntax crayon-theme-classic urvanov-syntax-highlighter-font-monaco urvanov-syntax-highlighter-os-pc print-yes notranslate" style="text-align: justify;" data-settings=" minimize scroll-mouseover"> <div class="urvanov-syntax-highlighter-plain-wrap">&nbsp;</div> <div class="urvanov-syntax-highlighter-main"> <table class="crayon-table"> <tbody> <tr class="urvanov-syntax-highlighter-row"> <td class="crayon-nums " data-settings="show"> <div class="urvanov-syntax-highlighter-nums-content"> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe80632200823148744-1">1</div> <div class="crayon-num crayon-striped-num" data-line="urvanov-syntax-highlighter-610fe80632200823148744-2">2</div> </div> </td> <td class="urvanov-syntax-highlighter-code"> <div class="crayon-pre"> <div id="urvanov-syntax-highlighter-610fe80632200823148744-1" class="crayon-line"><span class="crayon-e">mkdir </span><span class="crayon-v">Docker</span><span class="crayon-o">/</span><span class="crayon-e">key&nbsp;&nbsp;</span></div> <div id="urvanov-syntax-highlighter-610fe80632200823148744-2" class="crayon-line crayon-striped-line"><span class="crayon-e">cd </span><span class="crayon-v">Docker</span><span class="crayon-o">/</span><span class="crayon-v">key</span></div> </div> </td> </tr> </tbody> </table> </div> </div> <h4 id="ftoc-heading-6" class="ftwp-heading" style="text-align: justify;">PHẦN 2: Thiết lập nh&oacute;m bảo mật</h4> <p style="text-align: justify;"><strong>Bước 1)</strong>&nbsp;Bạn cần cấu h&igrave;nh một nh&oacute;m bảo mật. C&oacute; thể truy cập n&oacute; bằng bảng điều khiển.</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7662 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup7.png" alt="" width="221" height="209" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 2)</strong>&nbsp;Nhấp v&agrave;o Create Security Group</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7663 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup8.png" sizes="(max-width: 360px) 100vw, 360px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup8.png 360w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup8-300x59.png 300w" alt="" width="360" height="71" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 3)</strong>&nbsp;Trong m&agrave;n h&igrave;nh tiếp theo</p> <p style="text-align: justify;">1) Nhập t&ecirc;n nh&oacute;m bảo mật &lsquo;jupyter_docker&rsquo; v&agrave; M&ocirc; tả nh&oacute;m bảo mật cho Docker</p> <p style="text-align: justify;">2) Bạn cần th&ecirc;m 4 quy tắc sau:</p> <ul style="text-align: justify;"> <li>ssh: port 22, source Anywhere</li> <li>http: port 80, source Anywhere</li> <li>https: port 443, source Anywhere</li> <li>Custom TCP: port&nbsp; 8888, source Anywhere</li> </ul> <p style="text-align: justify;">3) Nhấp v&agrave;o Create</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7664 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup9.png" sizes="(max-width: 1035px) 100vw, 1035px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup9.png 1035w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup9-300x162.png 300w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup9-1024x553.png 1024w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup9-768x415.png 768w" alt="" width="1035" height="559" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 4)</strong>&nbsp;Nh&oacute;m bảo mật mới tạo sẽ được liệt k&ecirc;</p> <h4 id="ftoc-heading-7" class="ftwp-heading" style="text-align: justify;"><strong>Phần 3: Khởi chạy&nbsp;</strong><strong>instance</strong></h4> <p style="text-align: justify;">Cuối c&ugrave;ng bạn đ&atilde; sẵn s&agrave;ng để tạo instance.</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7665 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup11.png" alt="" width="235" height="212" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 1)</strong>&nbsp;Nhấp v&agrave;o Launch Instance</p> <p style="text-align: justify;">M&aacute;y chủ mặc định l&agrave; đủ cho nhu cầu của bạn. Bạn c&oacute; thể chọn Amazon Linux AMI.</p> <p style="text-align: justify;">AMI l&agrave; viết tắt của Amazon Machine Image. N&oacute; chứa th&ocirc;ng tin cần thiết để khởi động th&agrave;nh c&ocirc;ng một &nbsp;instance chạy tr&ecirc;n m&aacute;y chủ ảo được lưu trữ tr&ecirc;n đ&aacute;m m&acirc;y.</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7666 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup13.png" sizes="(max-width: 1356px) 100vw, 1356px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup13.png 1356w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup13-300x40.png 300w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup13-1024x136.png 1024w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup13-768x102.png 768w" alt="" width="1356" height="180" loading="lazy" /></p> <p style="text-align: justify;">Lưu &yacute; rằng AWS c&oacute; một m&aacute;y chủ d&agrave;nh ri&ecirc;ng cho học s&acirc;u, chẳng hạn như:</p> <ul style="text-align: justify;"> <li><strong>Deep Learning AMI (Ubuntu)</strong></li> <li><strong>Deep Learning AMI&nbsp;</strong></li> <li><strong>Deep Learning Base AMI (Ubuntu)&nbsp;</strong></li> </ul> <p style="text-align: justify;">Tất cả ch&uacute;ng đều đi k&egrave;m với c&aacute;c tệp nhị ph&acirc;n mới nhất của khung học s&acirc;u được c&agrave;i đặt sẵn trong c&aacute;c m&ocirc;i trường ảo ri&ecirc;ng biệt:</p> <ul style="text-align: justify;"> <li>TensorFlow,</li> <li>Caffe</li> <li>PyTorch,</li> <li>Keras,</li> <li>Theano</li> <li>CNTK.</li> </ul> <p style="text-align: justify;">Được cấu h&igrave;nh đầy đủ với NVidia CUDA, cuDNN v&agrave; NCCL cũng như Intel MKL-DNN.</p> <p style="text-align: justify;"><strong>Bước 2)</strong>&nbsp;Chọn t2.micro. N&oacute; l&agrave; một m&aacute;y chủ cấp miễn ph&iacute;. AWS cung cấp miễn ph&iacute; m&aacute;y ảo n&agrave;y được trang bị 1 vCPU v&agrave; 1 GB bộ nhớ. M&aacute;y chủ n&agrave;y cung cấp sự c&acirc;n bằng tốt giữa hiệu suất t&iacute;nh to&aacute;n, bộ nhớ v&agrave; mạng. N&oacute; ph&ugrave; hợp với cơ sở dữ liệu vừa v&agrave; nhỏ.</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7667 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup14.png" sizes="(max-width: 1600px) 100vw, 1600px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup14.png 1600w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup14-300x119.png 300w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup14-1024x408.png 1024w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup14-768x306.png 768w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup14-1536x612.png 1536w" alt="" width="1600" height="637" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 3)</strong>&nbsp;Giữ c&agrave;i đặt mặc định trong m&agrave;n h&igrave;nh tiếp theo v&agrave; nhấp v&agrave;o Next: Add Storage</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7668 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup15.png" sizes="(max-width: 1334px) 100vw, 1334px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup15.png 1334w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup15-300x141.png 300w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup15-1024x482.png 1024w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup15-768x362.png 768w" alt="" width="1334" height="628" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 4)</strong>&nbsp;Tăng dung lượng lưu trữ l&ecirc;n 10GB v&agrave; nhấp v&agrave;o Next</p> <p style="text-align: justify;"><strong>Bước 5)</strong>&nbsp;Giữ c&agrave;i đặt mặc định v&agrave; nhấp v&agrave;o Next: Configure Security Group</p> <p style="text-align: justify;"><strong>Bước 6)&nbsp;</strong>Chọn security group bạn đ&atilde; tạo trước đ&oacute;, l&agrave;<strong>&nbsp;jupyter_docker</strong></p> <p style="text-align: justify;"><strong>Bước 7)</strong>&nbsp;Xem lại c&agrave;i đặt của bạn v&agrave; nhấp v&agrave;o n&uacute;t launch</p> <p style="text-align: justify;"><strong>Bước 8)</strong>&nbsp;Bước cuối c&ugrave;ng l&agrave; li&ecirc;n kết cặp kh&oacute;a với&nbsp;instance.</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7674 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup20.png" sizes="(max-width: 698px) 100vw, 698px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup20.png 698w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup20-300x185.png 300w" alt="" width="698" height="430" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 9)</strong>&nbsp;Dưới đ&acirc;y l&agrave; t&oacute;m tắt về c&aacute;c instances hiện đang được sử dụng. Lưu &yacute; IP public</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7675 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup22.png" sizes="(max-width: 1431px) 100vw, 1431px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup22.png 1431w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup22-300x66.png 300w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup22-1024x226.png 1024w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup22-768x170.png 768w" alt="" width="1431" height="316" loading="lazy" /></p> <p style="text-align: justify;">Nhấp v&agrave;o Connect</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7676 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup23.png" sizes="(max-width: 533px) 100vw, 533px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup23.png 533w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup23-300x97.png 300w" alt="" width="533" height="172" loading="lazy" /></p> <p style="text-align: justify;">Bạn sẽ t&igrave;m thấy c&aacute;c lỗi kết nối</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7677 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup24.png" sizes="(max-width: 640px) 100vw, 640px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup24.png 640w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup24-300x205.png 300w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup24-90x60.png 90w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup24-95x64.png 95w" alt="" width="640" height="437" loading="lazy" /></p> <h5 id="ftoc-heading-8" class="ftwp-heading" style="text-align: justify;"><strong>Khởi chạy phi&ecirc;n bản của bạn (người d&ugrave;ng Mac OS)</strong></h5> <p style="text-align: justify;">L&uacute;c đầu, h&atilde;y đảm bảo rằng b&ecirc;n trong terminal, thư mục l&agrave;m việc của bạn trỏ đến thư mục c&oacute; key pair file docker</p> <p style="text-align: justify;">Chạy code:</p> <p style="text-align: justify;"><span id="urvanov-syntax-highlighter-610fe80632208476641523" class="urvanov-syntax-highlighter-syntax urvanov-syntax-highlighter-syntax-inline crayon-theme-classic crayon-theme-classic-inline urvanov-syntax-highlighter-font-monaco"><span class="crayon-pre urvanov-syntax-highlighter-code"><span class="crayon-i">chmod</span><span class="crayon-h">&nbsp;</span><span class="crayon-cn">400</span><span class="crayon-h">&nbsp;</span><span class="crayon-v">docker</span><span class="crayon-sy">.</span><span class="crayon-v">pem</span></span></span></p> <p style="text-align: justify;">Mở kết nối bằng code n&agrave;y.</p> <p style="text-align: justify;">C&oacute; hai code. Trong một số trường hợp, code đầu ti&ecirc;n tr&aacute;nh để Jupyter mở notebook</p> <p style="text-align: justify;">Trong trường hợp n&agrave;y, h&atilde;y sử dụng c&aacute;i thứ hai để buộc kết nối.</p> <div id="urvanov-syntax-highlighter-610fe8063220c925410101" class="urvanov-syntax-highlighter-syntax crayon-theme-classic urvanov-syntax-highlighter-font-monaco urvanov-syntax-highlighter-os-pc print-yes notranslate" style="text-align: justify;" data-settings=" minimize scroll-mouseover"> <div class="urvanov-syntax-highlighter-plain-wrap">&nbsp;</div> <div class="urvanov-syntax-highlighter-main"> <table class="crayon-table"> <tbody> <tr class="urvanov-syntax-highlighter-row"> <td class="crayon-nums " data-settings="show"> <div class="urvanov-syntax-highlighter-nums-content"> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe8063220c925410101-1">1</div> <div class="crayon-num crayon-striped-num" data-line="urvanov-syntax-highlighter-610fe8063220c925410101-2">2</div> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe8063220c925410101-3">3</div> <div class="crayon-num crayon-striped-num" data-line="urvanov-syntax-highlighter-610fe8063220c925410101-4">4</div> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe8063220c925410101-5">5</div> </div> </td> <td class="urvanov-syntax-highlighter-code"> <div class="crayon-pre"> <div id="urvanov-syntax-highlighter-610fe8063220c925410101-1" class="crayon-line"><span class="crayon-p"># If able to launch Jupyter</span></div> <div id="urvanov-syntax-highlighter-610fe8063220c925410101-2" class="crayon-line crayon-striped-line"><span class="crayon-v">ssh</span> <span class="crayon-o">-</span><span class="crayon-i">i</span> <span class="crayon-s">"docker.pem"</span> <span class="crayon-v">ec2</span><span class="crayon-o">-</span><span class="crayon-v">user</span><span class="crayon-sy">@</span><span class="crayon-v">ec2</span><span class="crayon-o">-</span><span class="crayon-cn">18</span><span class="crayon-o">-</span><span class="crayon-cn">219</span><span class="crayon-o">-</span><span class="crayon-cn">192</span><span class="crayon-o">-</span><span class="crayon-cn">34.us</span><span class="crayon-o">-</span><span class="crayon-v">east</span><span class="crayon-o">-</span><span class="crayon-cn">2.compute.amazonaws.com</span></div> <div id="urvanov-syntax-highlighter-610fe8063220c925410101-3" class="crayon-line"></div> <div id="urvanov-syntax-highlighter-610fe8063220c925410101-4" class="crayon-line crayon-striped-line"><span class="crayon-p"># If not able to launch Jupyter</span></div> <div id="urvanov-syntax-highlighter-610fe8063220c925410101-5" class="crayon-line"><span class="crayon-v">ssh</span> <span class="crayon-o">-</span><span class="crayon-i">i</span> <span class="crayon-s">"docker.pem"</span> <span class="crayon-v">ec2</span><span class="crayon-o">-</span><span class="crayon-v">user</span><span class="crayon-sy">@</span><span class="crayon-v">ec2</span><span class="crayon-o">-</span><span class="crayon-cn">18</span><span class="crayon-o">-</span><span class="crayon-cn">219</span><span class="crayon-o">-</span><span class="crayon-cn">192</span><span class="crayon-o">-</span><span class="crayon-cn">34.us</span><span class="crayon-o">-</span><span class="crayon-v">east</span><span class="crayon-o">-</span><span class="crayon-cn">2.compute.amazonaws.com</span> <span class="crayon-o">-</span><span class="crayon-i">L</span> <span class="crayon-cn">8888</span><span class="crayon-o">:</span><span class="crayon-cn">127.0.0.1</span><span class="crayon-o">:</span><span class="crayon-cn">8888</span></div> </div> </td> </tr> </tbody> </table> </div> </div> <p style="text-align: justify;">Lần đầu ti&ecirc;n, bạn sẽ được nhắc chấp nhận kết nối.</p> <h5 id="ftoc-heading-9" class="ftwp-heading" style="text-align: justify;"><strong>Khởi chạy phi&ecirc;n bản của bạn (người d&ugrave;ng&nbsp;</strong>Windows<strong>)</strong></h5> <p style="text-align: justify;"><strong>Bước 1)</strong>&nbsp;Truy cập trang web n&agrave;y để tải xuống PuTTY v&agrave; PuTTYgen&nbsp;<a href="https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html" target="_blank" rel="noopener">PuTTY</a>.</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7678 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup26.png" sizes="(max-width: 521px) 100vw, 521px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup26.png 521w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup26-300x106.png 300w" alt="" width="521" height="184" loading="lazy" /></p> <p style="text-align: justify;">B&acirc;y giờ cả hai phần mềm đ&atilde; được c&agrave;i đặt, bạn cần chuyển đổi tệp .pem th&agrave;nh .ppk. Tệp pem chứa kh&oacute;a duy nhất do AWS tạo.</p> <p style="text-align: justify;"><strong>Bước 2)</strong>&nbsp;Mở PuTTYgen v&agrave; nhấp v&agrave;o Load. Duyệt qua thư mục chứa tệp .pem.</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7679 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup27.png" sizes="(max-width: 564px) 100vw, 564px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup27.png 564w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup27-300x271.png 300w" alt="" width="564" height="509" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 3)</strong>&nbsp;Sau khi bạn tải tệp, bạn sẽ nhận được th&ocirc;ng b&aacute;o cho biết kh&oacute;a đ&atilde; được nhập th&agrave;nh c&ocirc;ng. Bấm v&agrave;o OK</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7680 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup28.png" sizes="(max-width: 636px) 100vw, 636px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup28.png 636w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup28-300x267.png 300w" alt="" width="636" height="567" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 4)</strong>&nbsp;Sau đ&oacute; nhấp v&agrave;o Save private key. Bạn được hỏi c&oacute; muốn lưu kh&oacute;a n&agrave;y m&agrave; kh&ocirc;ng c&oacute; cụm mật khẩu hay kh&ocirc;ng. Bấm v&agrave;o yes</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7681 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup29.png" sizes="(max-width: 489px) 100vw, 489px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup29.png 489w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup29-300x292.png 300w" alt="" width="489" height="476" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 5)</strong>&nbsp;Lưu kh&oacute;a</p> <p style="text-align: justify;"><strong>Bước 6)</strong>&nbsp;Truy cập AWS v&agrave; sao ch&eacute;p public DNS</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7682 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup31.png" sizes="(max-width: 628px) 100vw, 628px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup31.png 628w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup31-300x46.png 300w" alt="" width="628" height="97" loading="lazy" /></p> <p style="text-align: justify;">Mở PuTTY v&agrave; d&aacute;n DNS c&ocirc;ng khai v&agrave;o Host Name</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7683 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup32.png" sizes="(max-width: 507px) 100vw, 507px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup32.png 507w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup32-300x270.png 300w" alt="" width="507" height="456" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 7)</strong></p> <ol style="text-align: justify;"> <li>Tr&ecirc;n bảng điều khiển b&ecirc;n tr&aacute;i, mở SSH v&agrave; mở Auth</li> <li>Duyệt qua Private Key. Bạn n&ecirc;n chọn .ppk</li> <li>Nhấp v&agrave;o Open.</li> </ol> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7684 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup33.png" sizes="(max-width: 462px) 100vw, 462px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup33.png 462w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup33-300x290.png 300w" alt="" width="462" height="447" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 8)</strong></p> <p style="text-align: justify;">Khi bước n&agrave;y ho&agrave;n th&agrave;nh, một cửa sổ mới sẽ được mở ra. Nhấp v&agrave;o Yes nếu bạn thấy cửa sổ bật l&ecirc;n n&agrave;y</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7685 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup34.png" sizes="(max-width: 377px) 100vw, 377px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup34.png 377w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup34-300x220.png 300w" alt="" width="377" height="276" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 9)&nbsp;</strong>Bạn cần đăng nhập với t&ecirc;n: ec2-user</p> <p style="text-align: justify;"><strong>Bước 10)&nbsp;</strong>Bạn được kết nối với Amazon Linux AMI.</p> <p style="text-align: justify;"><img class="aligncenter disappear appear" src="https://www.guru99.com/images/1/080618_0532_HowtouseJup36.png" /></p> <h4 id="ftoc-heading-10" class="ftwp-heading" style="text-align: justify;">Phần 4: C&agrave;i đặt Docker</h4> <p style="text-align: justify;">Trong khi bạn được kết nối với m&aacute;y chủ qua Putty / Terminal, bạn c&oacute; thể c&agrave;i đặt v&ugrave;ng chứa Docker. Thực thi c&aacute;c code sau</p> <div id="urvanov-syntax-highlighter-610fe80632212268895715" class="urvanov-syntax-highlighter-syntax crayon-theme-classic urvanov-syntax-highlighter-font-monaco urvanov-syntax-highlighter-os-pc print-yes notranslate" style="text-align: justify;" data-settings=" minimize scroll-mouseover"> <div class="urvanov-syntax-highlighter-plain-wrap">&nbsp;</div> <div class="urvanov-syntax-highlighter-main"> <table class="crayon-table"> <tbody> <tr class="urvanov-syntax-highlighter-row"> <td class="crayon-nums " data-settings="show"> <div class="urvanov-syntax-highlighter-nums-content"> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe80632212268895715-1">1</div> <div class="crayon-num crayon-striped-num" data-line="urvanov-syntax-highlighter-610fe80632212268895715-2">2</div> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe80632212268895715-3">3</div> <div class="crayon-num crayon-striped-num" data-line="urvanov-syntax-highlighter-610fe80632212268895715-4">4</div> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe80632212268895715-5">5</div> </div> </td> <td class="urvanov-syntax-highlighter-code"> <div class="crayon-pre"> <div id="urvanov-syntax-highlighter-610fe80632212268895715-1" class="crayon-line"><span class="crayon-e">sudo </span><span class="crayon-e">yum </span><span class="crayon-v">update</span> <span class="crayon-o">-</span><span class="crayon-i">y</span></div> <div id="urvanov-syntax-highlighter-610fe80632212268895715-2" class="crayon-line crayon-striped-line"><span class="crayon-e">sudo </span><span class="crayon-e">yum </span><span class="crayon-v">install</span> <span class="crayon-o">-</span><span class="crayon-i">y</span> <span class="crayon-e">docker</span></div> <div id="urvanov-syntax-highlighter-610fe80632212268895715-3" class="crayon-line"><span class="crayon-e">sudo </span><span class="crayon-e">service </span><span class="crayon-e">docker </span><span class="crayon-e">start</span></div> <div id="urvanov-syntax-highlighter-610fe80632212268895715-4" class="crayon-line crayon-striped-line"><span class="crayon-e">sudo </span><span class="crayon-v">user</span><span class="crayon-o">-</span><span class="crayon-v">mod</span> <span class="crayon-o">-</span><span class="crayon-v">a</span> <span class="crayon-o">-</span><span class="crayon-i">G</span> <span class="crayon-e">docker </span><span class="crayon-v">ec2</span><span class="crayon-o">-</span><span class="crayon-e">user</span></div> <div id="urvanov-syntax-highlighter-610fe80632212268895715-5" class="crayon-line"><span class="crayon-v">exit</span></div> </div> </td> </tr> </tbody> </table> </div> </div> <p style="text-align: justify;">Khởi chạy lại kết nối</p> <div id="urvanov-syntax-highlighter-610fe80632216377035289" class="urvanov-syntax-highlighter-syntax crayon-theme-classic urvanov-syntax-highlighter-font-monaco urvanov-syntax-highlighter-os-pc print-yes notranslate" style="text-align: justify;" data-settings=" minimize scroll-mouseover"> <div class="urvanov-syntax-highlighter-plain-wrap">&nbsp;</div> <div class="urvanov-syntax-highlighter-main"> <table class="crayon-table"> <tbody> <tr class="urvanov-syntax-highlighter-row"> <td class="crayon-nums " data-settings="show"> <div class="urvanov-syntax-highlighter-nums-content"> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe80632216377035289-1">1</div> </div> </td> <td class="urvanov-syntax-highlighter-code"> <div class="crayon-pre"> <div id="urvanov-syntax-highlighter-610fe80632216377035289-1" class="crayon-line"><span class="crayon-v">ssh</span> <span class="crayon-o">-</span><span class="crayon-i">i</span> <span class="crayon-s">"docker.pem"</span> <span class="crayon-v">ec2</span><span class="crayon-o">-</span><span class="crayon-v">user</span><span class="crayon-sy">@</span><span class="crayon-v">ec2</span><span class="crayon-o">-</span><span class="crayon-cn">18</span><span class="crayon-o">-</span><span class="crayon-cn">219</span><span class="crayon-o">-</span><span class="crayon-cn">192</span><span class="crayon-o">-</span><span class="crayon-cn">34.us</span><span class="crayon-o">-</span><span class="crayon-v">east</span><span class="crayon-o">-</span><span class="crayon-cn">2.compute.amazonaws.com</span> <span class="crayon-o">-</span><span class="crayon-i">L</span> <span class="crayon-cn">8888</span><span class="crayon-o">:</span><span class="crayon-cn">127.0.0.1</span><span class="crayon-o">:</span><span class="crayon-cn">8888</span></div> </div> </td> </tr> </tbody> </table> </div> </div> <p style="text-align: justify;">Người d&ugrave;ng Windows sử dụng SSH như đ&atilde; đề cập ở tr&ecirc;n</p> <h4 id="ftoc-heading-11" class="ftwp-heading" style="text-align: justify;">Phần 5: C&agrave;i đặt Jupyter</h4> <p style="text-align: justify;">Bước 1) Tạo Jupyter với h&igrave;nh ảnh được tạo sẵn</p> <div id="urvanov-syntax-highlighter-610fe80632219571784307" class="urvanov-syntax-highlighter-syntax crayon-theme-classic urvanov-syntax-highlighter-font-monaco urvanov-syntax-highlighter-os-pc print-yes notranslate" style="text-align: justify;" data-settings=" minimize scroll-mouseover"> <div class="urvanov-syntax-highlighter-plain-wrap">&nbsp;</div> <div class="urvanov-syntax-highlighter-main"> <table class="crayon-table"> <tbody> <tr class="urvanov-syntax-highlighter-row"> <td class="crayon-nums " data-settings="show"> <div class="urvanov-syntax-highlighter-nums-content"> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe80632219571784307-1">1</div> <div class="crayon-num crayon-striped-num" data-line="urvanov-syntax-highlighter-610fe80632219571784307-2">2</div> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe80632219571784307-3">3</div> <div class="crayon-num crayon-striped-num" data-line="urvanov-syntax-highlighter-610fe80632219571784307-4">4</div> </div> </td> <td class="urvanov-syntax-highlighter-code"> <div class="crayon-pre"> <div id="urvanov-syntax-highlighter-610fe80632219571784307-1" class="crayon-line"><span class="crayon-p">## Tensorflow</span></div> <div id="urvanov-syntax-highlighter-610fe80632219571784307-2" class="crayon-line crayon-striped-line"><span class="crayon-e">docker </span><span class="crayon-v">run</span> <span class="crayon-o">-</span><span class="crayon-v">v</span> <span class="crayon-o">~</span><span class="crayon-o">/</span><span class="crayon-v">work</span><span class="crayon-o">:</span><span class="crayon-o">/</span><span class="crayon-v">home</span><span class="crayon-o">/</span><span class="crayon-v">jovyan</span><span class="crayon-o">/</span><span class="crayon-v">work</span> <span class="crayon-o">-</span><span class="crayon-v">d</span> <span class="crayon-o">-</span><span class="crayon-i">p</span> <span class="crayon-cn">8888</span><span class="crayon-o">:</span><span class="crayon-cn">8888</span> <span class="crayon-v">jupyter</span><span class="crayon-o">/</span><span class="crayon-v">tensorflow</span><span class="crayon-o">-</span><span class="crayon-i">notebook</span></div> <div id="urvanov-syntax-highlighter-610fe80632219571784307-3" class="crayon-line"><span class="crayon-p">## Sparkdocker</span></div> <div id="urvanov-syntax-highlighter-610fe80632219571784307-4" class="crayon-line crayon-striped-line"><span class="crayon-v">run</span> <span class="crayon-o">-</span><span class="crayon-v">v</span> <span class="crayon-o">~</span><span class="crayon-o">/</span><span class="crayon-v">work</span><span class="crayon-o">:</span><span class="crayon-o">/</span><span class="crayon-v">home</span><span class="crayon-o">/</span><span class="crayon-v">jovyan</span><span class="crayon-o">/</span><span class="crayon-v">work</span> <span class="crayon-o">-</span><span class="crayon-v">d</span> <span class="crayon-o">-</span><span class="crayon-i">p</span> <span class="crayon-cn">8888</span><span class="crayon-o">:</span><span class="crayon-cn">8888</span> <span class="crayon-v">jupyter</span><span class="crayon-o">/</span><span class="crayon-v">pyspark</span><span class="crayon-o">-</span><span class="crayon-v">notebook</span></div> </div> </td> </tr> </tbody> </table> </div> </div> <p style="text-align: justify;">Giải th&iacute;ch code</p> <ul style="text-align: justify;"> <li>docker run: Chạy h&igrave;nh ảnh</li> <li>v: Đ&iacute;nh k&egrave;m một volume</li> <li>~/work:/home/jovyan/work: Volume</li> <li>8888:8888: port</li> <li>jupyter/datascience-notebook: Image</li> </ul> <p style="text-align: justify;">Cấp quyền cho jupyter notebook</p> <div id="urvanov-syntax-highlighter-610fe8063221c937472615" class="urvanov-syntax-highlighter-syntax crayon-theme-classic urvanov-syntax-highlighter-font-monaco urvanov-syntax-highlighter-os-pc print-yes notranslate" style="text-align: justify;" data-settings=" minimize scroll-mouseover"> <div class="urvanov-syntax-highlighter-plain-wrap">&nbsp;</div> <div class="urvanov-syntax-highlighter-main"> <table class="crayon-table"> <tbody> <tr class="urvanov-syntax-highlighter-row"> <td class="crayon-nums " data-settings="show"> <div class="urvanov-syntax-highlighter-nums-content"> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe8063221c937472615-1">1</div> </div> </td> <td class="urvanov-syntax-highlighter-code"> <div class="crayon-pre"> <div id="urvanov-syntax-highlighter-610fe8063221c937472615-1" class="crayon-line"><span class="crayon-e">sudo </span><span class="crayon-i">chown</span> <span class="crayon-cn">1000</span> <span class="crayon-o">~</span><span class="crayon-o">/</span><span class="crayon-v">work</span></div> </div> </td> </tr> </tbody> </table> </div> </div> <p style="text-align: justify;"><strong>Bước 2)</strong>&nbsp;C&agrave;i đặt c&acirc;y để xem thư mục l&agrave;m việc</p> <div id="urvanov-syntax-highlighter-610fe8063221f627329663" class="urvanov-syntax-highlighter-syntax crayon-theme-classic urvanov-syntax-highlighter-font-monaco urvanov-syntax-highlighter-os-pc print-yes notranslate" style="text-align: justify;" data-settings=" minimize scroll-mouseover"> <div class="urvanov-syntax-highlighter-plain-wrap">&nbsp;</div> <div class="urvanov-syntax-highlighter-main"> <table class="crayon-table"> <tbody> <tr class="urvanov-syntax-highlighter-row"> <td class="crayon-nums " data-settings="show"> <div class="urvanov-syntax-highlighter-nums-content"> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe8063221f627329663-1">1</div> </div> </td> <td class="urvanov-syntax-highlighter-code"> <div class="crayon-pre"> <div id="urvanov-syntax-highlighter-610fe8063221f627329663-1" class="crayon-line"><span class="crayon-e">sudo </span><span class="crayon-e">yum </span><span class="crayon-v">install</span> <span class="crayon-o">-</span><span class="crayon-i">y</span> <span class="crayon-v">tree</span></div> </div> </td> </tr> </tbody> </table> </div> </div> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7686 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup37.png" sizes="(max-width: 349px) 100vw, 349px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup37.png 349w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup37-300x94.png 300w" alt="" width="349" height="109" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 3)</strong></p> <p style="text-align: justify;">1. Kiểm tra v&ugrave;ng chứa v&agrave; t&ecirc;n của n&oacute; (thay đổi với mọi c&agrave;i đặt) Sử dụng lệnh</p> <div id="urvanov-syntax-highlighter-610fe80632222499050744" class="urvanov-syntax-highlighter-syntax crayon-theme-classic urvanov-syntax-highlighter-font-monaco urvanov-syntax-highlighter-os-pc print-yes notranslate" style="text-align: justify;" data-settings=" minimize scroll-mouseover"> <div class="urvanov-syntax-highlighter-plain-wrap">&nbsp;</div> <div class="urvanov-syntax-highlighter-main"> <table class="crayon-table"> <tbody> <tr class="urvanov-syntax-highlighter-row"> <td class="crayon-nums " data-settings="show"> <div class="urvanov-syntax-highlighter-nums-content"> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe80632222499050744-1">1</div> </div> </td> <td class="urvanov-syntax-highlighter-code"> <div class="crayon-pre"> <div id="urvanov-syntax-highlighter-610fe80632222499050744-1" class="crayon-line"><span class="crayon-e">docker </span><span class="crayon-v">ps</span></div> </div> </td> </tr> </tbody> </table> </div> </div> <p style="text-align: justify;">2. Lấy t&ecirc;n v&agrave; sử dụng log để mở Jupyter. Trong b&agrave;i n&agrave;y, t&ecirc;n của v&ugrave;ng chứa l&agrave; vigilant_easley. Sử dụng lệnh</p> <div id="urvanov-syntax-highlighter-610fe80632225977626928" class="urvanov-syntax-highlighter-syntax crayon-theme-classic urvanov-syntax-highlighter-font-monaco urvanov-syntax-highlighter-os-pc print-yes notranslate" style="text-align: justify;" data-settings=" minimize scroll-mouseover"> <div class="urvanov-syntax-highlighter-plain-wrap">&nbsp;</div> <div class="urvanov-syntax-highlighter-main"> <table class="crayon-table"> <tbody> <tr class="urvanov-syntax-highlighter-row"> <td class="crayon-nums " data-settings="show"> <div class="urvanov-syntax-highlighter-nums-content"> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe80632225977626928-1">1</div> </div> </td> <td class="urvanov-syntax-highlighter-code"> <div class="crayon-pre"> <div id="urvanov-syntax-highlighter-610fe80632225977626928-1" class="crayon-line"><span class="crayon-e">docker </span><span class="crayon-e">logs </span><span class="crayon-v">vigilant_easley</span></div> </div> </td> </tr> </tbody> </table> </div> </div> <p style="text-align: justify;">Lấy URL</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7687 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup38.png" sizes="(max-width: 1271px) 100vw, 1271px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup38.png 1271w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup38-300x104.png 300w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup38-1024x356.png 1024w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup38-768x267.png 768w" alt="" width="1271" height="442" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 4)&nbsp;</strong></p> <p style="text-align: justify;">Trong URL</p> <div id="urvanov-syntax-highlighter-610fe80632228240973659" class="urvanov-syntax-highlighter-syntax crayon-theme-classic urvanov-syntax-highlighter-font-monaco urvanov-syntax-highlighter-os-pc print-yes notranslate" style="text-align: justify;" data-settings=" minimize scroll-mouseover"> <div class="urvanov-syntax-highlighter-plain-wrap">&nbsp;</div> <div class="urvanov-syntax-highlighter-main"> <table class="crayon-table"> <tbody> <tr class="urvanov-syntax-highlighter-row"> <td class="crayon-nums " data-settings="show"> <div class="urvanov-syntax-highlighter-nums-content"> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe80632228240973659-1">1</div> </div> </td> <td class="urvanov-syntax-highlighter-code"> <div class="crayon-pre"> <div id="urvanov-syntax-highlighter-610fe80632228240973659-1" class="crayon-line"><span class="crayon-v">http</span><span class="crayon-o">:</span><span class="crayon-c">//(90a3c09282d6 or 127.0.0.1):8888/?token=f460f1e79ab74c382b19f90fe3fd55f9f99c5222365eceed</span></div> </div> </td> </tr> </tbody> </table> </div> </div> <p style="text-align: justify;">Thay thế (90a3c09282d6 hoặc 127.0.0.1) bằng DNS c&ocirc;ng khai của phi&ecirc;n bản của bạn</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7688 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup39.png" sizes="(max-width: 702px) 100vw, 702px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup39.png 702w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup39-300x178.png 300w" alt="" width="702" height="417" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 5)</strong></p> <p style="text-align: justify;">URL mới trở th&agrave;nh</p> <div id="urvanov-syntax-highlighter-610fe8063222b890157979" class="urvanov-syntax-highlighter-syntax crayon-theme-classic urvanov-syntax-highlighter-font-monaco urvanov-syntax-highlighter-os-pc print-yes notranslate" style="text-align: justify;" data-settings=" minimize scroll-mouseover"> <div class="urvanov-syntax-highlighter-plain-wrap">&nbsp;</div> <div class="urvanov-syntax-highlighter-main"> <table class="crayon-table"> <tbody> <tr class="urvanov-syntax-highlighter-row"> <td class="crayon-nums " data-settings="show"> <div class="urvanov-syntax-highlighter-nums-content"> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe8063222b890157979-1">1</div> </div> </td> <td class="urvanov-syntax-highlighter-code"> <div class="crayon-pre"> <div id="urvanov-syntax-highlighter-610fe8063222b890157979-1" class="crayon-line"><span class="crayon-v">http</span><span class="crayon-o">:</span><span class="crayon-c">//ec2-174-129-135-16.compute-1.amazonaws.com:8888/?token=f460f1e79ab74c382b19f90fe3fd55f9f99c5222365eceed</span></div> </div> </td> </tr> </tbody> </table> </div> </div> <p style="text-align: justify;">Bước 6) Sao ch&eacute;p v&agrave; d&aacute;n URL v&agrave;o tr&igrave;nh duyệt của bạn. Jupyter mở</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7689 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup40.png" sizes="(max-width: 618px) 100vw, 618px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup40.png 618w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup40-300x127.png 300w" alt="" width="618" height="261" loading="lazy" /></p> <p style="text-align: justify;"><strong>Bước 7)</strong></p> <p style="text-align: justify;">Bạn c&oacute; thể viết một Notebook mới trong thư mục c&ocirc;ng việc</p> <p style="text-align: justify;"><img class="aligncenter size-full wp-image-7690 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup41.png" sizes="(max-width: 1159px) 100vw, 1159px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup41.png 1159w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup41-300x82.png 300w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup41-1024x279.png 1024w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup41-768x209.png 768w" alt="" width="1159" height="316" loading="lazy" /></p> <h4 id="ftoc-heading-12" class="ftwp-heading" style="text-align: justify;">Phần 6: Đ&oacute;ng kết nối</h4> <p style="text-align: justify;">Đ&oacute;ng kết nối trong teminal</p> <div id="urvanov-syntax-highlighter-610fe8063222f957312211" class="urvanov-syntax-highlighter-syntax crayon-theme-classic urvanov-syntax-highlighter-font-monaco urvanov-syntax-highlighter-os-pc print-yes notranslate" style="text-align: justify;" data-settings=" minimize scroll-mouseover"> <div class="urvanov-syntax-highlighter-plain-wrap">&nbsp;</div> <div class="urvanov-syntax-highlighter-main"> <table class="crayon-table"> <tbody> <tr class="urvanov-syntax-highlighter-row"> <td class="crayon-nums " data-settings="show"> <div class="urvanov-syntax-highlighter-nums-content"> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe8063222f957312211-1">1</div> </div> </td> <td class="urvanov-syntax-highlighter-code"> <div class="crayon-pre"> <div id="urvanov-syntax-highlighter-610fe8063222f957312211-1" class="crayon-line"><span class="crayon-v">exit</span></div> </div> </td> </tr> </tbody> </table> </div> </div> <p style="text-align: justify;">Quay lại AWS v&agrave; dừng m&aacute;y chủ.<img class="aligncenter size-full wp-image-7691 disappear appear" src="../../wp-content/uploads/2021/01/080618_0532_HowtouseJup42.png" sizes="(max-width: 716px) 100vw, 716px" srcset="https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup42.png 716w, https://old.tek4.vn/wp-content/uploads/2021/01/080618_0532_HowtouseJup42-300x145.png 300w" alt="" width="716" height="347" loading="lazy" /></p> <h5 id="ftoc-heading-13" class="ftwp-heading" style="text-align: justify;">Xử l&yacute; sự cố</h5> <p style="text-align: justify;">Nếu docker kh&ocirc;ng hoạt động, h&atilde;y thử tạo lại image bằng c&aacute;ch sử dụng</p> <div id="urvanov-syntax-highlighter-610fe80632232157314395" class="urvanov-syntax-highlighter-syntax crayon-theme-classic urvanov-syntax-highlighter-font-monaco urvanov-syntax-highlighter-os-pc print-yes notranslate" style="text-align: justify;" data-settings=" minimize scroll-mouseover"> <div class="urvanov-syntax-highlighter-plain-wrap">&nbsp;</div> <div class="urvanov-syntax-highlighter-main"> <table class="crayon-table"> <tbody> <tr class="urvanov-syntax-highlighter-row"> <td class="crayon-nums " data-settings="show"> <div class="urvanov-syntax-highlighter-nums-content"> <div class="crayon-num" data-line="urvanov-syntax-highlighter-610fe80632232157314395-1">1</div> </div> </td> <td class="urvanov-syntax-highlighter-code"> <div class="crayon-pre"> <div id="urvanov-syntax-highlighter-610fe80632232157314395-1" class="crayon-line"><span class="crayon-e">docker </span><span class="crayon-v">run</span> <span class="crayon-o">-</span><span class="crayon-v">v</span> <span class="crayon-o">~</span><span class="crayon-o">/</span><span class="crayon-v">work</span><span class="crayon-o">:</span><span class="crayon-o">/</span><span class="crayon-v">home</span><span class="crayon-o">/</span><span class="crayon-v">jovyan</span><span class="crayon-o">/</span><span class="crayon-v">work</span> <span class="crayon-o">-</span><span class="crayon-v">d</span> <span class="crayon-o">-</span><span class="crayon-i">p</span> <span class="crayon-cn">8888</span><span class="crayon-o">:</span><span class="crayon-cn">8888</span> <span class="crayon-v">jupyter</span><span class="crayon-o">/</span><span class="crayon-v">tensorflow</span><span class="crayon-o">-</span><span class="crayon-v">notebook</span></div> </div> </td> </tr> </tbody> </table> </div> </div> <h3 id="ftoc-heading-14" class="ftwp-heading" style="text-align: justify;">Kết Luận</h3> <ul style="text-align: justify;"> <li>Jupyter notebook l&agrave; một ứng dụng web nơi bạn c&oacute; thể chạy code Python v&agrave; R của m&igrave;nh. Dễ d&agrave;ng chia sẻ v&agrave; ph&acirc;n t&iacute;ch dữ liệu phong ph&uacute; với Jupyter.</li> <li>Để khởi chạy jupyter, h&atilde;y viết v&agrave;o terminal: jupyter notebook</li> <li>Bạn c&oacute; thể lưu sổ ghi ch&eacute;p của m&igrave;nh bất cứ l&uacute;c n&agrave;o bạn muốn</li> <li>Mỗi &ocirc; chứa code Python của bạn. Kernel sẽ đọc code từng &ocirc; một.</li> <li>Bạn c&oacute; thể sử dụng ph&iacute;m tắt để chạy một &ocirc;. Theo mặc định: Ctrl + Enter</li> </ul> <p style="text-align: justify;">B&agrave;i viết tiếp theo:&nbsp;<a href="../../kien-thuc-co-ban-ve-tensorflow-tu-hoc-tensorflow/" target="_blank" rel="noopener">Kiến thức cơ bản về TensorFlow</a></p>