# AWS EC2 and SageMaker ## EC2 ### 選擇區域 建議使用**新加坡**或**東京**,連線速度較快。 ![image](https://hackmd.io/_uploads/HkNGNimV6.png) ### Select OS and Machine Image ![image](https://hackmd.io/_uploads/ByP0l5qmp.png) Supported EC2 instance table: https://docs.aws.amazon.com/dlami/latest/devguide/appendix-ami-release-notes.html ### Select執行個體類型 選擇的執行個體類型必須出現在上面的Supported EC2 instances。 ![image](https://hackmd.io/_uploads/HJJbz5c7T.png) 執行個體命名規則: https://aws.amazon.com/tw/ec2/instance-types/ ### 建立金鑰對 點建立新的金鑰對,會自動下載pem檔到電腦裡。 ![image](https://hackmd.io/_uploads/H1Aqmccmp.png) ### 啟動執行個體並連線 ![image](https://hackmd.io/_uploads/ryztV5c76.png) ``` ssh -i "g58large.pem" ubuntu@ec2-3-27-18-120.ap-southeast-2.compute.amazonaws.com ``` ### 連進機器 ![image](https://hackmd.io/_uploads/Hk3CEq9mT.png) ![image](https://hackmd.io/_uploads/HyO7Sqqm6.png) ![image](https://hackmd.io/_uploads/rJeLrqqXp.png) conda init bash完要exit再重連。 ![image](https://hackmd.io/_uploads/Bk2k8c5QT.png) ### 關機 **停止**而非**終止**。終止將會關機並刪除。 ![image](https://hackmd.io/_uploads/ryZ33o7Ep.png) ## SageMaker ### 進入SageMaker 左邊點擊筆記本→筆記本執行個體: ![image](https://hackmd.io/_uploads/SJrC4i746.png) ### 建立筆記本執行個體 ![image](https://hackmd.io/_uploads/SJXUroQEa.png) 輸入名稱並選擇執行個體類型。要選擇**加速運算**區的才能用GPU。 ![image](https://hackmd.io/_uploads/S1bASo7N6.png) ### 開啟Jupyter ![image](https://hackmd.io/_uploads/S1UdLiXNp.png) ### 測試 ![image](https://hackmd.io/_uploads/HJ3T8iQ46.png)