{"id":125,"date":"2021-10-26T03:37:21","date_gmt":"2021-10-26T03:37:21","guid":{"rendered":"http:\/\/18.141.20.153\/?p=125"},"modified":"2025-08-22T08:13:48","modified_gmt":"2025-08-22T08:13:48","slug":"how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2","status":"publish","type":"post","link":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/","title":{"rendered":"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?"},"content":{"rendered":"<span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">11<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span>\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/iO_MsNtShqxzf5_rzVN_EqRHl851G7zae2lrrW4LnFi-AA0dJR_yipiMzaTliBpmLvaP1XeWKYUuhG89v48OdxxmODsPxl5e_pCmek9Yhc_gRYzILCvL9hBMLqckpDJ_3lsXhSpw=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Data scientists, machine learning engineers, and practitioners must devote significant time and resources to developing, testing, updating, and optimizing Docker images for deep learning. Instead of concentrating on developing and enhancing models, practitioners are forced to divert valuable resources to unrelated tasks. Installing packages, resolving compatibility concerns, performance optimization, and integrating and testing with Amazon Sagemaker, Amazon EC2, Amazon ECS, and Amazon EKS are examples of these tasks. AWS DL Containers provide deep learning Docker environments that are fully tested and optimized and require no installation, configuration, or maintenance. Deep learning practitioners using TensorFlow, PyTorch, or Apache MXNet will find everything they need to be packaged and optimized in these Docker images.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">In this blog, we will explore AWS Deep Learning Containers, its features, and benefits, and learn How to Train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2.<\/p>\n\n\n\n<p><strong>In this blog, we will cover:<\/strong><\/p>\n\n\n\n<ul><li>AWS Deep Learning Containers<\/li><li>Key features of AWS Deep Learning Containers<\/li><li>Benefits of AWS Deep Learning Containers<\/li><li>Pricing of AWS Deep Learning Containers<\/li><li>Hands-on<\/li><li>Customers of AWS Deep Learning Containers<\/li><li>Conclusion<\/li><\/ul>\n\n\n\n<h2>AWS Deep Learning Containers<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/swYkxiuIL2VJrm53slaWrHON4BwKHVeXhYd_XHyShYeveTDYXvYEK6CSXW-_Oyem_d-i6W9tfC2k0-BsEZoPo6v7o-N848jc3m69Pvw0yN8VH0WAguiSspFZjcAMMnzMMqrFRksR=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">AWS Deep Learning Containers are Docker images pre-installed with deep learning frameworks.&nbsp; It allows you to quickly deploy custom machine learning (ML) environments by avoiding the time-consuming process of constructing and optimizing environments from scratch. TensorFlow, PyTorch, and Apache MXNet are supported by AWS DL Containers. You can use <a href=\"https:\/\/www.workfall.com\/learning\/blog\/how-to-build-ml-models-to-generate-accurate-predictions-without-writing-code-using-amazon-sagemaker-canvas\/\">Amazon SageMaker<\/a>, <a href=\"https:\/\/www.workfall.com\/learning\/blog\/how-to-build-a-high-availability-cluster-using-eks-without-having-to-be-an-expert-in-managing-kubernetes-clusters\/\">Amazon Elastic Kubernetes Service (Amazon EKS)<\/a>, self-managed Kubernetes on Amazon EC2, and Amazon Elastic Container Service to deploy AWS DL Containers (Amazon ECS). The containers are free to use and may be found on Amazon Elastic Container Registry (Amazon ECR) and AWS Marketplace. You just pay for the resources you use.<\/p>\n\n\n\n<h2>Key Features of AWS Deep Learning Containers<\/h2>\n\n\n\n<ul><li><strong>Customizable container images: <\/strong>Pre-packaged docker container images are fully configured and validated.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/3O__hHyv7aQlH52B4mLDzcWCUBvNNXSD9G9bWB9pmxqLg5RuiRnf1TvEH2ZkNTXXZLVD7Gf2XSMcfElv7MyqHFOfJYsd_m4eC5sy4Q7fKjeM3kKMMvmUT8Atfw3yiGcJQDE3Tmlf=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<ul><li><strong>Best performance and scalability without tuning: <\/strong>Support for TensorFlow, Apache, MXNet<\/li><\/ul>\n\n\n\n<ul><li><strong>Single and multi-node training and interference: <\/strong>Works with Amazon EKS, Amazon ECS, and Amazon EC2<\/li><\/ul>\n\n\n\n<h2>Benefits of AWS Deep Learning Containers<\/h2>\n\n\n\n<p class=\"has-text-align-justify\"><strong>Start building immediately: <\/strong>Deep learning environments may be deployed in minutes using pre-packaged Docker images. The images are completely tested and contain the essential deep learning framework libraries (currently TensorFlow, PyTorch, and Apache MXNet). For greater control over monitoring, compliance, and data processing, you can easily layer your own libraries and tools on top of these images.<\/p>\n\n\n\n<p class=\"has-text-align-justify\"><strong>Get the best performance automatically:<\/strong> AWS DL Containers feature AWSoptimizations and enhancements to the newest versions of popular frameworks and libraries, including TensorFlow, PyTorch, and Apache MXNet, to give the best training and inference performance in the cloud. AWS TensorFlow enhancements, for example, allow models to train up to twice as fast because of enhanced GPU scalability.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/s042ppFSuwQTj59gyyNi-ZonrGNmyb5iqpsKXEToOTvu8-IZJjLAu3ZQoj2FdmfJTlWWZPwE8blRnD_EVknKg3LveWKGjIjUSYSLBMF513NiYQW2MAzUWYQthC-LsHPrMq6ajouQ=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\"><strong>Quickly add machine learning to Kubernetes applications: <\/strong>AWS DL containers are designed to integrate with Amazon EC2&#8217;s Kubernetes. If you have Kubernetes apps running on Amazon EC2, you can use AWS DL Containers to easily integrate machine learning as a microservice to those applications.<\/p>\n\n\n\n<p class=\"has-text-align-justify\"><strong>Easily manage machine learning workflows: <\/strong>AWS DL Containers are strongly linked with Amazon SageMaker, Amazon EKS, and Amazon ECS, allowing you to create custom machine learning processes for training, validation, and deployment with ease. Amazon EKS and Amazon ECS manage all of the container orchestration required to launch and scale AWS DL Containers on clusters of virtual machines as a result of this interaction.<\/p>\n\n\n\n<h2>Pricing of AWS Deep Learning Containers<\/h2>\n\n\n\n<p class=\"has-text-align-justify\">AWS DL Containers are available at no additional charge. You just pay for the AWS resources you use, such as Amazon Sagemaker, Amazon EC2, Amazon ECS, Amazon EKS, and other AWS services.<\/p>\n\n\n\n<h2>Hands-on<\/h2>\n\n\n\n<p class=\"has-text-align-justify\">In this hands-on, we will see how we can start training deep learning models with AWS Deep Learning containers on Amazon EC2. AWS Deep Learning Containers (AWS DL Containers) are Docker images pre-installed with deep learning frameworks to make it easy to deploy custom machine learning (ML) environments quickly by letting you skip the complicated process of building and optimizing your environments from scratch. Docker containers are a popular way to deploy custom ML environments that run consistently in multiple environments. AWS DL Containers provide Docker images that are pre-installed and tested with the latest versions of popular deep learning frameworks and the libraries they require. We will first create an IAM user with access to Amazon ECS and attach an inline policy to the same user for Amazon ECR. Modifying the private VPCs to auto-assign IPv4 addresses, we will then navigate through the various steps on the Amazon EC2 dashboard to configure a Deep Learning Base AMI instance and launch it with a private RSA key- pair. Performing the configurations for the EC2 instance, we will then connect to the Deep Learning Base AMI instance via an SSH client. On the command line, changing the rights for the private RSA key-pair, we will then connect to the EC2 instance and log in to the console adding the Access Key ID and Secret Access Key of the newly created user. Finally, on successful login, we will then log in to Amazon ECR, pull the Deep Learning Container images if it doesn\u2019t exist locally, clone a repository that consists of multiple models, and test the configuration via training an example model or any other model as per your requirements.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/2fcnWahAxC0zew-UnD4f-5b6hJFhubjMqXqZXHO7lv7WNgO3UD1U7AhSTvXKBOpG-D5oO1h55MPE9kBMnf6ivbhz1ty8cnKzG5EztXhxn-nJVQowyzj5DNSCB5rA4rxiFCu7csNf=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p><strong>To implement this, we will do the following:<\/strong><\/p>\n\n\n\n<ul><li>Login to your AWS console and navigate to the dashboard.<\/li><li>Navigate to the IAM console and create a new IAM user with the required policies attached to it.<\/li><li>Attach existing policies and an inline policy to the IAM user.<\/li><li>Make a note of the Secret Access Key and Access Key ID.<\/li><li>Search for the VPC service and navigate to the subnets of the created VPC.<\/li><li>Switch on \u2018Auto-assign IPv4 addresses\u2019 for your subnets in the created VPC.<\/li><li>Navigate back to the EC2 dashboard and launch a new Deep Learning Base AMI instance.<\/li><li>Navigate through all the creation steps and change the configurations as shown in the below steps in this hands-on.<\/li><li>Review all the configurations and create a private new key pair and download the key while launching the instance.<\/li><li>Connect to the newly created EC2 instance either via EC2 connect or SSH client.<\/li><li>Change the rights for the .pem file in the folder you downloaded the key pair.<\/li><li>SSH into the ec2 instance using the command line and executing the required commands.<\/li><li>On success, log in to your AWS account using the Access Key ID and Secret Access Key.<\/li><li>Login to AWS ECR using a command provided in the hands-on.<\/li><li>Pull the Deep Learning Container images using a Docker command if it doesn\u2019t exist locally.<\/li><li>Finally, clone a repository and train the models to test the connection or you can train your own models as per your requirements.<\/li><li>In case you are just following the hands-on for learning purposes, make sure to eliminate all the resources you created throughout the hands-on.<\/li><\/ul>\n\n\n\n<p>Login to your AWS console and navigate to the dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/U8ew4VF6Ia1qdMa9hpAzjoa1rj3MdDAvyhcSsmXEJ4ewXAB2OTkXO1O2YlfCvWefpyPUr55hOIoIXLgjp9IwrJKIPCYh2Gn6MjbVedAb-35QciNY63meux7U8PfZaGz-XI7oqyBl=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>Search for the IAM service.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/r2iBuy8uGVgYSgrMbkfOsIFfhFjwAsdoIFOrGxCbWuwXBRYghLCk6Hvp62XAiga0sI7r2YXJX2orufHFaU20OCD8o3QjeLbejO6H-N4_QljgcfC2v2iqrvg7ooh3ml-InpaAakR8=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p>You will be navigated to the IAM dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/hIlU0LLP7uI2eJm2-cf0-wxi7VeQZlhPwgySWOZAv0urwJp1eVFKHrqn8WWH8ZTX1_GpyFwGzQHEYk5zrLHbEdyrEdRGOkPe7GL5SEeCveTF9Mq_9UpxU_pEkOHTIhTTfrJhjB5G=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>Now click on Users and navigate to the Users dashboard. Click on Add users.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/nCfBMMtljDiSS3DiAW1kxUXLn3dstM-tCcRKkbTwf9XlIx6vA_JwPAiq9Tg7H3ce_Y5d5JgQRbs3OxmP5ir46FKMlYjLIW02FsUqOnFQ4HqIAhtZVOxPKFD6OF1hGQBn4o_EHHHl=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">You will be navigated to the Create user dashboard. Enter a user name for the new IAM user. And select Programmatic access. Click on Next: Permissions.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/SIN2WTqu9ohLmSntCpteur-KDDnsZeFV_soTjNXKLAtOgLvNs6JDodQd4hI6bShBKp185EQdZ2z2AvGhV4nx6MyQ6D6boBgcrXZq2fCvczFSOXf3O5hQWd0nxsZDqHjKoJtAih_N=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Select Attach existing policies directly. Search for AmazonECS and select AmazonECS_FullAccess. Click on Next: Tags.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/5QyX0FUGnI6AKD0f-d-TSYEfpM8toqYhtgynhd3qiEQH3tBuAh3a8RHB4-O-vL8stSuvyQRF3HZXbCb0OxtFE8ZVZnpx3Mhm9tdmK6hs8s3490HJx60StxnIVotuPT_WGEJdOR2_=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p>Enter tags for the new IAM user if needed. Click Next: Review.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/3QQoWIIwrJbQ3R9VH2eMJ9lKAKw0dZdEBl02H0jFugA9L5fQ9opSshXwzRRPZpqOHqki1jOsJyFwGDC7OvpPM-6M40yww66gLR5KmrfPIji5x7rDIhCRoLuGaB5ZbNErs5qL9IBN=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>Review all the changes and once done, click on Create user.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/iCD-4_XTgZ60rNW3C0kw0apfQjt_pcOHgSIliU0BjWn0eyEFKkPjUjmXGY6cTW5AjxP3AGmDrQvrEpUTMxW1SZi_hSSim8tJG1FWM5Sd9r216qK2zoRmkLhOg1oAORsm2e0im25-=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">On success, you will see the screen as shown in the image below. Make sure to download the .csv file and save it in a secure place. Now, click Close.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/Yg55IV9lTUaW6dREFstVfxu6XBOudBf3wBsX71xO04ahpeEGzE7kGlihKRhZ_U7BiEfYq8FYN2CT04DqTQQISseh0kguIE0yCf4qdjRCkTkR7hjGXbbMDbnBSTKX55k7KqOxPLHq=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>On success, you will see the screen as shown in the image below. Now, select the newly created user.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/r6-GS3QBlAgG-tKnimFEIPDg7Y62uQnZap9R4Og8JcgJkfFmedGSPlvKjOAoadO_YLoVPydu6pt133ewwJy0OyaOExQ6lB3xadIQxPrfZZO2ttU8EZ6Lnk0NzAqCtBm9wNOuNFxY=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p>Click on Add inline policy.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/mQsrAJzEFAwHOKCN33XNu_P4QtEeNXRBmqBNXDGDSneF6276Lcn_29txESF9Ivrs_gU7_AttzcOBcazoTliztXDwjsh8iz6Z3WwD0eA1Do0Jw0zifJO0XpTePsRi2ZCT_gKpYeSw=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>Add the following policy in the JSON tab. Once done, click on Attach Policy.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n{\n       &quot;Version&quot;: &quot;2012-10-17&quot;,\n       &quot;Statement&quot;: &#91;\n              {\n                     &quot;Action&quot;: &quot;ecr:*&quot;,\n                     &quot;Effect&quot;: &quot;Allow&quot;,\n                     &quot;Resource&quot;: &quot;*&quot;\n              }\n       ]\n}\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/3-iZsTJfga4G-kqnmFIdb-Q-WPZmbfBRVc5qKGPNw6sQ-eJVyESp_o47zFIrhy5MVFbctKELpOAammSHFwITn5vLgULCl_DKykb-PEBfoOURLOgYgSB2WLx-QMYbP0vkQ70RObcD=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p>Review the policy changes and click on Create policy.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/DOE8a9nmHpPXjNugeF4A3QRHEkWoURH9iwp0nXNa1kxwjlPvdqAqyGojkoYcNH8L5AgnG1vrsxqGRIYDFa76PeVEnNiIKWHes-a6HVRU7n7ln4yKpypGrunx1_gqy9KYn0OJ2XNq=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>You will see the newly created policy attached to the newly created user.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/-ftMDJ8n3g5a-Oc5riHNlWmBQPXtLEW-0r8Wa210TEllvJwDQG4hD1m_SumyBvUlN3PnIdLA8-89yT76SCalvI6fnzHWsQFWP8KUE-CCKQPDtkt6IweoUQTSv4_XIvOfbzWMlVMJ=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p>Now, search for the VPC service.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/qqMOtdhIYm-wTQpjxkOs9YcI4vWhn1wxioLG8q1igUL7PcDAALUjACLjvq05VN49nJNMbWsEi2kQ4w5ene76vnTqlo70BUctJMb4YljNSxzFink4u6tZAiBlSbFUlPsI7dq28qAV=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Next, you need to ensure that your subnet has the \u201cEnable auto-assign public IPv4 address\u201d checked (enabled). This is to be ensured since you will have to connect to your EC2 instance to make sure the SSM agent is installed on your instance. Without the public IPv4 address, you will not be allowed to connect to your instance.<\/p>\n\n\n\n<p>To enable\/verify it, navigate to the Amazon VPC dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/vqa0DbSGMUOfTxCjhkm6YAdULMIOCAYulJwRG3b0OrQ2tK7CpfotzXBTJBjNLzv0BqPUt0VYVuIPkWHEr-jS-nGQW4vMxhOmMRh0rWeFBBd5GDVeCfYgkT3vZPNQhpDOa2axiXUi=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p>Click on \u201cSubnets\u201d on the left navigation pane under the \u201cVirtual Private Cloud\u201d section.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/WSqwK964d4ZMg_4WG1EA-AIVt8hoL06cUOPYsZfVWoVDrc8TSp-MzZv56nl_RWpKvh8fIWzE-FXd-HplKe66yJyeaiajol7rPyW2fJN5AC-oOPB2e-hHM2l20zHQUtQA0pl906Ug=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>Select your subnet in which you will be creating your instance and click on \u201cActions\u201d.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/ayYebsjgGHZ3nHFQe7Ixxz0tNd4unPBe7kj5guCXKEDgmwXBqHVdGKiwLoNQ0PuF_95AQWPiiyBU8zgBHXC9u7cUHnrMdxL5b630asbxF1rinCsmQaotC8xZ0XaDA-5Q0tB4VH23=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Select \u201cModify auto-assign IP settings\u201d. Ensure that the checkbox for \u201cEnable auto-assign public IPv4 address\u201d is checked and click on \u201cSave\u201d.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/eFBrCkEs8QJ7aqdhgKJuCr4lw_LPM4liWkrnAOGjyuoTjQT8vb4P_moIgUOshL5V5y_wSe3PkhERcPzreEUnbnxXId_odZA1car2xBzCkEzwxo8lTtj2ElSMsKwAYO1CjcBYpWfs=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>On success, you will get a success message as shown in the below image.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/161VcPMGQd3Yos8HTJAbQNXyoUANf271xiYaHJqGzytqrqrMRFDpryUmhpEVcVvdAz7_aAP4JBcewRYpEmIShkuIDjM526LdJK4gJwbGTnzM70t03i5G8ma6GIfUcwiuD0sVrKG9=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>Now, search for the EC2 service and navigate to the EC2 dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/uF77IxzI80RUc5l7rb5AmHu04Nq_BuNBlWPZUm_6_hilt1uuBJALzNCrbZZjLeOgHORvkZwdF-EDxNSCO_Quc1kGotpsCM-K597u8ARGrNQTlvnzdWwTlH__RVWAVkgYWFEvA0Ue=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p>Click on Instances and navigate to the Instances dashboard. Click on Launch instances.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/q9WGHmpA_H10lMXDolaRKCLBbBCEB_b31WHhx9JgeY79Kf5mrYclvnpqiCCvVcEJioRnKcAAjOZyEvcTCQm5UgmLwjX2G0gGaV1F-M8JmM_16qdXtmSed8Z4RzhkinaizV2oTucH=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>Search for Deep Learning Base AMI.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/4wu5VG-yRcMCZzLArKEvf4AR9eFCeipylqYzhkaxecIjkk1CgO1-8PyV2I2hWD4Tfp3QfWV7PRt_r05nS-jRcYvqkJTnsCeVc59cPp3epNa8yGs0m1aRtsgVyGemUKN5hnW-e3Is=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p>Scroll down and select the Deep Learning Base AMI (Amazon Linux). Click on Select.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/89o15x8AWLsj7IIzLzRLWu9gdgQa9lu-GooQeIlGWCKV2Z-c1xobDZ2HJBXwJbUFs1wfTCfupXpNO6Fq5cMYPVFgYqtDcTxLTiCfQQax-ba_3TvzfZh_zLsVLpi_3wRdrtW5ZDrk=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>In the next step, select the instance type as c5.large. Click on Next: Configure Instance Details.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/ew31ke_y70Yi6I3Io4XQRvtr-KzXio7BOawCFN713e23D8NKmm9JQM_1ds1t_pQosty5basv9iy5tcMlpgXxLzaCB_HY3-XCu5_reIHrMlpcxTGnADg97G3WPny3HcI_O869DK3Y=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p>In the 3rd step, configure the instance details or leave it as it is by default. Click on Next: Add Storage.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/erC8h2h4roK-HUDBW7csBzFzhMONzbKPrrlHOSWoSVGqhnujpFvpTGnAO2ltZFe0M5Mg4WYyTcSF4vGDZh4qQ-XOVkwgcxTmED5vI43KAWV_pyhwZtRMCi6zF9-44RaLedHCAvLG=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>Alter the storage requirements as per your needs. Click on Next: Add Tags.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/RpckpkqyAgjQkCHvOdrN86Cno9ih6nmECsAOIkBpi5C9_iaGRwxSA3ZqPqe5pp4uWnq5Na74JQvNCgibXtAkBNzaBFYHL8CTyBHMINgADvPgasEjovr10uD7MOi2B3hCmC3rZi_J=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p>Add tags for your EC2 instance if any needed. Click on Next: Configure Security Groups.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/sFCvkhejDlM9sCIwmQVpe9HQsab6S7Y2y5leyaObBhZPu5gW5aKswgy5m8Q62OrZhBN5GvA-ByfT-HtbND0z-ykqF1AD5p60zuRxJ-AouyUtlgDevw6w41rT2KtMEYrteG7JFXXQ=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>Finally, click on Review and Launch.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/NpSAs7QhJyRE1rr8Cn-H-u2f2QrAWITRICXIE4o-EvPJdXy-7Vym0WrMzq9_cAdBPKuQHcuYWTwFlAdUzDwUeOeYpLQlOC6687pmcobDnPRp-pmD2m4zn728bbMOUJa87S321dZs=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>Review the settings for your EC2 instance and click on Launch.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/vCH1bwpzE6SyiNinu_IYYYAWoOikmzTq5a65tn4yf_SaKTdIBu4HuIRe4Y04HWTW9wqXxX4mlLFHdpS9RAa9RC-HaL12J0oabgQMg10WjEZxaU6g2N8jney2lD9CZYuBMAcciFja=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Select Create a new key pair, key pair type as RSA and enter a name for the key pair. Download the key pair by clicking the download button and finally click on Launch instance.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/FL0-bpvB2fHJgiuAvxhPyQ5z28spozsHhXtzAw5myWan-nH6Owl-8EK6G0ZBoDGKpmA2vqIfS_5ev58C898FVroILFxbK2eBVwQANnYSzPoZCig1ws06uXgSWfM1l2pQCJ6hsJso=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>On success, you will see the screen as shown in the image below. Scroll down and click on View Instances.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/n8FXljUIP263Jrcaq-Y-fGu93S5xsKU9H-yExdcxUusOdMk6Hv1Tj8JJ5TfE1-PlvBBN_mGPdZOJCcTTacPXB-K_1hstmW14pdzfdl8p7-TosggIJOKtUZo0HMhFuxHZ6UrmVccM=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>You will see your newly launched instance in the Running state.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/pdzfbvRniy-6Be14mj14HIgJbFizq35S1wxWirA1oHO2x8Api65cpE1wA4OY-WrK7l_WYlcmvlP7njw_ECilIk5q696BmMqHjGXp9hisk3igUO2OlL5Hhgv8xgdVQzKthEwLlaVT=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p>Navigate to the folder wherein you stored your EC2 key pair.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/FnoDwSjw8QAgmb-nV77hbh46F9tZ1S-HQ2SSqRg4sOeQWdvlOFKc6-Oh5lU9RDGvVTvGyWbu8B5zUbXJoBHSSjVS7wTyot-ktJC-OgqzAHhWtfd41rd85hulCtHZDiDpWIkqUCyh=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>Open command prompt or bash terminal in the same folder and execute the command:<\/p>\n\n\n\n<p><code>chmod 0400 &lt;your .pem filename&gt;<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/Tw_I3eWEhfg9GQ70OVKS1nNYCzDf6G9QrC5Ii9Ds9yFt6_7BWT3_C5ImFNDfTdEg6T-31mNgm-vbEHsJ55b7P5XEbjNAN58KHvCD0VW-qBOq50IuD_8UxAZaeh7--NjQq4HbLVnT=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>Now, execute either of the two commands to ssh into the newly created instance:<\/p>\n\n\n\n<p><code>ssh -i \"ECS-ECR.pem\" <a href=\"mailto:ec2-user@ec2-18-142-162-225.ap-southeast-1.compute.amazonaws.com\">ec2-user@ec2-18-142-162-225.ap-southeast-1.compute.amazonaws.com<\/a><\/code><\/p>\n\n\n\n<p><code>ssh -L localhost:8888:localhost:8888 -i ECS-ECR.pem <a href=\"mailto:ec2-user@ec2-18-142-162-225.ap-southeast-1.compute.amazonaws.com\">ec2-user@ec2-18-142-162-225.ap-southeast-1.compute.amazonaws.com<\/a><\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/cnt857gA2VqARmBXLXZhhL_grfZWnSP1j9VdZEeYVug6VFBkeIgz1WTjn3JFCDmdf3uYqMLQV9a9C0jGEnnEPKtPbNakRVIErM-5v-8tPOfLCSt79woWUhA8LQJxBVuHt1pqup5h=s1600\" alt=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"\/><\/figure>\n\n\n\n<p>Login to your AWS account using the newly created user. Execute the command:&nbsp;<\/p>\n\n\n\n<p><code>aws configure<\/code><\/p>\n\n\n\n<p>Enter in the AWS Access Key ID, Secret Access Key and the default region name.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/qmaScS1KZrI5a2Zwic_E2-VfAt1dovnKo8WoDk-mz9_512aednkkS10aGL8sUWFHGo7D1cAxRGbz9EgwRC8FY49wgxaMWPprjoMGRHZbL8DW9eUDQZMzbxJshr8pRt4MBZkcokne=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>Login to AWS ECR using the command:<\/p>\n\n\n\n<p><code>$(aws ecr get-login --region ap-southeast-1 --no-include-email --registry-ids 763104351884)<\/code><\/p>\n\n\n\n<p>You need to include \u2018$\u2019 and parentheses in your command. You will see \u2018Login Succeeded\u2019 when this step concludes.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/bx7JSuwxMA1cPoc5swq2tmnRGajPM_EOHpvmj7PMN7ZxKpAqb4ft1_XcKodtC8jwlj8e62L08ZgEZBRKHGEog4Wuzinlj_EiO71Tl4DcWRcI84S3baDi5K6E-WYXHLXJwo1jdq0x=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">You will now run AWS Deep Learning Container images on your EC2 instance using the command below. The command below will automatically pull the Deep Learning Container image if it doesn\u2019t exist locally.<\/p>\n\n\n\n<p><code>docker run -it 763104351884.dkr.ecr.ap-southeast-1.amazonaws.com\/tensorflow-training:1.13-cpu-py36-ubuntu16.04<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/NaoJ9RAB1AzTTPnWCTT6FOHfWt9tV_LVgXG30rxgqwAfBdEyWHX_1v25BHf4pGyQpr9FSwEms_Rjo0SBF6ZTTtVZ6a8a0NYwRksysnNfhyKTNA8anX79MN7ITrvaBiDu6ysJt2FR=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>On success, you will see the screen as shown in the image below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/-tISHbnPkGyc5baCRmhWEtQktaCFZvlCndexRSGcMNZsv29RjmevdBgLCEXMJIAV1Huo0O4ue8trlZpthHJa9ahUH4rYy2lJRQKMVv47yWgP7earH3TN1RzvpJO1iIvWEA8_-WWp=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>We will clone the Keras repository, which includes example python scripts to train models.<\/p>\n\n\n\n<p><code>git clone <a href=\"https:\/\/github.com\/fchollet\/keras.git\">https:\/\/github.com\/fchollet\/keras.git<\/a><\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/3opFV29ZHoIAxB_l2XN5w7Z82Azl-G3eckCOffSEeRdy1jQRZ0s4vg2YgvfWtc-fcLAbbhddn-jDJl_6MPP9mS9YxLBc-HZ9I4nnxR3HmCuVe-JhVl68iQBIzZ_hOXM_Vua8Cv3N=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>Executing the command below, you will find the cloned repo on your EC2 instance.<\/p>\n\n\n\n<p>ls<\/p>\n\n\n\n<p>You can now start training your own models or any example models from the cloned repository.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/CffIzaFwV2MY6SCJfRNU2yh0lw5L51iaFUJTcqVOF4TftiD4B9cjuDmLWBtS4ZkQ6cHUwApL4r0j-kD-Sj-vsFfhNIiXCd0aoJLS0qv1B9woBNCFYiMABDY-mtxJuCqkC8otoXsQ=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<h2>Customers of AWS Deep Learning Containers<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/jodKYa2oYdgP3ooLsfqCrK4ZBSyn-Az2EYpwvymo8EmYsbLIQ6xSI7N5I4gEkDnYdlOrXKcjfN0Z4jpsGv2HtcUAdGpL-ZSpi7DbtTCgkh1LVzzO247yb2HSoh5BD33RZiTSTxuv=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<h2>Conclusion<\/h2>\n\n\n\n<p class=\"has-text-align-justify\">In this blog, we learned about AWS Deep Learning Containers, its key features, benefits, pricing, and customers. We also saw how we can start training deep learning models with AWS Deep Learning containers on Amazon EC2. We first created an IAM user with access to Amazon ECS and attached an inline policy to the same user for Amazon ECR. Modifying the private VPCs to auto-assign IPv4 addresses, we then navigated through the various steps on the Amazon EC2 dashboard to configure a Deep Learning Base AMI instance and launch it with a private RSA key pair. Performing the configurations for the EC2 instance, we then connected to the Deep Learning Base AMI instance via an SSH client. On the command line, changing the rights for the private RSA key-pair, we connected to the EC2 instance and logged into the console adding the Access Key ID and Secret Access Key of the newly created user. Finally, on successful login, we then logged into Amazon ECR, pulled the Deep Learning Container images if they didn&#8217;t exist locally, cloned a repository consisting of multiple models, and tested the configuration. We will discuss more use cases of Amazon Deep Learning Containers in our upcoming blogs. Stay tuned to keep getting all updates about our upcoming new blogs on AWS and relevant technologies.<\/p>\n\n\n\n<p>Meanwhile \u2026<\/p>\n\n\n\n<p><strong>Keep Exploring -&gt; Keep Learning -&gt; Keep Mastering<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-justify\">This blog is part of our effort towards building a knowledgeable and kick-ass tech community. At <a href=\"https:\/\/www.workfall.com\/\">Workfall<\/a>, we strive to provide the best tech and pay opportunities to AWS-certified talents. If you\u2019re looking to work with global clients, build kick-ass products while making big bucks doing so, give it a shot at<a href=\"https:\/\/www.workfall.com\/partner\/\"> workfall.com\/partner<\/a> today.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">11<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span> Data scientists, machine learning engineers, and practitioners must devote significant time and resources to developing, testing, updating, and optimizing Docker images for deep learning. Instead of concentrating on developing and enhancing models, practitioners are forced to divert valuable resources to unrelated tasks. Installing packages, resolving compatibility concerns, performance optimization, and integrating and testing with Amazon [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":283,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[2],"tags":[3,14,16,15,11,6],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2? - The Workfall Blog<\/title>\n<meta name=\"description\" content=\"In this blog, we will learn how to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2? - The Workfall Blog\" \/>\n<meta property=\"og:description\" content=\"In this blog, we will learn how to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/\" \/>\n<meta property=\"og:site_name\" content=\"The Workfall Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/workfall\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-26T03:37:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-22T08:13:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/CoverImages_1200x628px-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@workfall\" \/>\n<meta name=\"twitter:site\" content=\"@workfall\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Workfall\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"20 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#organization\",\"name\":\"Workfall - Hire #Kickass Coders On Demand\",\"url\":\"https:\/\/18.141.20.153\/learning\/blog\/\",\"sameAs\":[\"https:\/\/www.instagram.com\/workfall\/\",\"https:\/\/www.linkedin.com\/company\/workfall\/\",\"https:\/\/facebook.com\/workfall\",\"https:\/\/twitter.com\/workfall\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400\",\"contentUrl\":\"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400\",\"width\":400,\"height\":400,\"caption\":\"Workfall - Hire #Kickass Coders On Demand\"},\"image\":{\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#website\",\"url\":\"https:\/\/18.141.20.153\/learning\/blog\/\",\"name\":\"The Workfall Blog\",\"description\":\"#Tech #Remote #Jobs\",\"publisher\":{\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/18.141.20.153\/learning\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/#primaryimage\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/CoverImages_1200x628px-2.png\",\"contentUrl\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/CoverImages_1200x628px-2.png\",\"width\":1200,\"height\":628,\"caption\":\"Train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/#webpage\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/\",\"name\":\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2? - The Workfall Blog\",\"isPartOf\":{\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/#primaryimage\"},\"datePublished\":\"2021-10-26T03:37:21+00:00\",\"dateModified\":\"2025-08-22T08:13:48+00:00\",\"description\":\"In this blog, we will learn how to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2.\",\"breadcrumb\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/18.141.20.153\/learning\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/#webpage\"},\"author\":{\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a\"},\"headline\":\"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?\",\"datePublished\":\"2021-10-26T03:37:21+00:00\",\"dateModified\":\"2025-08-22T08:13:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/#webpage\"},\"wordCount\":2160,\"publisher\":{\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/CoverImages_1200x628px-2.png\",\"keywords\":[\"AWS\",\"containers\",\"deep learning\",\"docker\",\"ec2\",\"workfall\"],\"articleSection\":[\"AWS Cloud Computing\"],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a\",\"name\":\"Workfall\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png\",\"contentUrl\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png\",\"caption\":\"Workfall\"},\"sameAs\":[\"https:\/\/www.workfall.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2? - The Workfall Blog","description":"In this blog, we will learn how to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/","og_locale":"en_US","og_type":"article","og_title":"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2? - The Workfall Blog","og_description":"In this blog, we will learn how to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2.","og_url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/","og_site_name":"The Workfall Blog","article_publisher":"https:\/\/facebook.com\/workfall","article_published_time":"2021-10-26T03:37:21+00:00","article_modified_time":"2025-08-22T08:13:48+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/CoverImages_1200x628px-2.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_creator":"@workfall","twitter_site":"@workfall","twitter_misc":{"Written by":"Workfall","Est. reading time":"20 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/18.141.20.153\/learning\/blog\/#organization","name":"Workfall - Hire #Kickass Coders On Demand","url":"https:\/\/18.141.20.153\/learning\/blog\/","sameAs":["https:\/\/www.instagram.com\/workfall\/","https:\/\/www.linkedin.com\/company\/workfall\/","https:\/\/facebook.com\/workfall","https:\/\/twitter.com\/workfall"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400","contentUrl":"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400","width":400,"height":400,"caption":"Workfall - Hire #Kickass Coders On Demand"},"image":{"@id":"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/logo\/image\/"}},{"@type":"WebSite","@id":"https:\/\/18.141.20.153\/learning\/blog\/#website","url":"https:\/\/18.141.20.153\/learning\/blog\/","name":"The Workfall Blog","description":"#Tech #Remote #Jobs","publisher":{"@id":"https:\/\/18.141.20.153\/learning\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/18.141.20.153\/learning\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/#primaryimage","url":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/CoverImages_1200x628px-2.png","contentUrl":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/CoverImages_1200x628px-2.png","width":1200,"height":628,"caption":"Train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2"},{"@type":"WebPage","@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/#webpage","url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/","name":"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2? - The Workfall Blog","isPartOf":{"@id":"https:\/\/18.141.20.153\/learning\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/#primaryimage"},"datePublished":"2021-10-26T03:37:21+00:00","dateModified":"2025-08-22T08:13:48+00:00","description":"In this blog, we will learn how to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2.","breadcrumb":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/18.141.20.153\/learning\/blog\/"},{"@type":"ListItem","position":2,"name":"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?"}]},{"@type":"Article","@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/#article","isPartOf":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/#webpage"},"author":{"@id":"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a"},"headline":"How to train a Deep Learning model with AWS Deep Learning Containers on Amazon EC2?","datePublished":"2021-10-26T03:37:21+00:00","dateModified":"2025-08-22T08:13:48+00:00","mainEntityOfPage":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/#webpage"},"wordCount":2160,"publisher":{"@id":"https:\/\/18.141.20.153\/learning\/blog\/#organization"},"image":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-train-a-deep-learning-model-with-aws-deep-learning-containers-on-amazon-ec2\/#primaryimage"},"thumbnailUrl":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/CoverImages_1200x628px-2.png","keywords":["AWS","containers","deep learning","docker","ec2","workfall"],"articleSection":["AWS Cloud Computing"],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a","name":"Workfall","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/person\/image\/","url":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png","contentUrl":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png","caption":"Workfall"},"sameAs":["https:\/\/www.workfall.com"]}]}},"jetpack_featured_media_url":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/CoverImages_1200x628px-2.png","jetpack-related-posts":[{"id":215,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-install-and-run-docker-containers-on-amazon-ec2-instance\/","url_meta":{"origin":125,"position":0},"title":"How to install and run Docker Containers on Amazon EC2 Instance?","date":"October 27, 2021","format":false,"excerpt":"While running Docker on AWS, developers and admins can build, ship, and run highly reliable distributed applications at any scale.\u00a0\u00a0In this blog, we will demonstrate how to install, build and run docker containers on Amazon EC2 instances. Refer to Part 1 of the blog here: How To Install And Run\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"Insrall and Run Docker on Amazon EC2 - Workfall","src":"https:\/\/i1.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/docker.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":635,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-install-and-run-docker-container-on-amazon-ec2-instance-part-1\/","url_meta":{"origin":125,"position":1},"title":"How to install and run Docker Container on Amazon EC2 Instance (Part 1)?","date":"November 11, 2021","format":false,"excerpt":"The fast rise in interest and use of container-based solutions has necessitated the development of industry standards for container technology and the packaging of software code. Docker is currently one of the most well-known and widely utilized container engines on the market. Docker was launched in 2013 by a company\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"Running Docker on Amazon EC2","src":"https:\/\/i2.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/CoverImages_1200x628px-4.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2266,"url":"https:\/\/learning.workfall.com\/learning\/blog\/deploying-a-rust-rocket-rest-api-on-aws-ec2-with-docker-and-github-actions\/","url_meta":{"origin":125,"position":2},"title":"Deploying a Rust Rocket REST API on AWS EC2 with Docker and GitHub Actions","date":"May 16, 2023","format":false,"excerpt":"When Rust compiles code, you get an executable if you created the application using the --bin command. In this blog, we shall look at how we can create a Dockerfile to create an image with this executable. We shall then deploy this image on EC2 using GitHub Actions which will\u2026","rel":"","context":"In &quot;Backend Development&quot;","img":{"alt_text":"Deploying a Rust Rocket REST API on AWS EC2 with Docker and GitHub Actions","src":"https:\/\/i0.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/05\/Cover-Images_Part2-1-1.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":399,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-create-and-mount-an-amazon-efs-file-system-using-amazon-ec2-launch-instance-wizard\/","url_meta":{"origin":125,"position":3},"title":"How to create and mount an Amazon EFS file system using Amazon EC2 Launch Instance Wizard?","date":"November 3, 2021","format":false,"excerpt":"Sizing, configuring, and deploying AWS resources for third-party applications, such as SAP or SQL server is always challenging for you. Are you looking for a wizard who can help you with these challenging tasks?\u00a0 AWS Launch Wizard can help you in simplifying these tasks by offering a guided way of\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"How to create and mount an Amazon EFS file system using Amazon EC2 Launch Instance Wizard","src":"https:\/\/i2.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/Launch-Wizard.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":675,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-set-up-a-continuous-deployment-pipeline-to-deploy-versions-of-an-application-on-aws-elastic-beanstalk-using-aws-codepipeline-part-1\/","url_meta":{"origin":125,"position":4},"title":"How to set up a continuous deployment pipeline to deploy versions of an application on AWS Elastic Beanstalk using AWS CodePipeline (Part 1)?","date":"November 24, 2021","format":false,"excerpt":"Do you have concerns about managing and deploying web applications? With AWS Elastic Beanstalk, you can launch your full web application in just a few minutes by simply uploading the code. Starting with capacity provisioning, load balancing, auto-scaling, and application health monitoring, this service will take care of the whole\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"AWS Elastic Beanstalk - Workfall","src":"https:\/\/i2.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/CoverImages_1200x628px-6.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":464,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-establish-and-maintain-a-scalable-network-using-amazon-managed-blockchain-part-2\/","url_meta":{"origin":125,"position":5},"title":"How to establish and maintain a scalable network using Amazon Managed Blockchain (Part 2)?","date":"November 9, 2021","format":false,"excerpt":"In our previous blog on how to establish and maintain a scalable network using Amazon Managed Blockchain (Part 1), we discussed Blockchain and Amazon Managed Blockchain. We have also discussed its components, benefits, features, pricing, customers, and how it works. In this blog, we will discuss how to use AWS\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"Amazon Managed Blockchain","src":"https:\/\/i2.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/blockchain2.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts\/125"}],"collection":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/comments?post=125"}],"version-history":[{"count":14,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts\/125\/revisions"}],"predecessor-version":[{"id":2259,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts\/125\/revisions\/2259"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/media\/283"}],"wp:attachment":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/media?parent=125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/categories?post=125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/tags?post=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}