AWS Machine Learning Blog

Get Started with Deep Learning Using the AWS Deep Learning AMI

Whether you’re new to deep learning or want to build advanced deep learning projects in the cloud, it’s easy to get started by using AWS.

Amazon SageMaker, our fully-managed machine learning platform, makes it easy to quickly and easily build, train, and deploy machine learning models at any scale. The AWS Deep Learning AMIs (Amazon Machine Images) let you build custom environments and workflows. Both Amazon SageMaker and the AMIs come pre-installed with popular open-source deep learning frameworks including TensorFlow, Apache MXNet, PyTorch, and Chainer, all optimized for high performance on AWS. In this blog post, we’ll focus on the AMIs. For information about getting started with Amazon SageMaker, see this blog post.

You can train custom models, experiment with new algorithms, and learn new deep learning skills and techniques. There is no additional charge to use the AMIs—you pay only for the AWS resources needed to store and run your applications. 

The AMIs offer GPU acceleration through pre-configured CUDA and cuDNN drivers, as well as CPU acceleration through Intel MKL-DNN drivers. Available for both Ubuntu and Amazon Linux, the AMIs also come bundled with popular data science and Python packages. In addition, you can choose either Conda AMIs with pre-installed frameworks and drivers in separate virtual environments, or base AMIs that allow end-to-end customization.

In this step-by-step tutorial, we’ll show you how to set up the AWS Deep Learning AMIs. 

Step 1: Open the EC2 Console

Sign into the AWS Management Console with your user name and password to get started. Then type EC2 in the search bar and open the EC2 service console.

Step 1b: Choose the Launch Instance button

Step 2a: Select the AWS Deep Learning AMI

Choose the AWS Marketplace tab on the left, and then search for “deep learning ubuntu.” Select the Deep Learning AMI (Ubuntu). You can also select the Base AMI to set up custom builds of deep learning frameworks. Both AMIs are also available for Ubuntu and Amazon Linux.

Step 2b: On the details page, choose Continue

Step 3a: Select an instance type

Choose an instance type for your deep learning training and deployment needs, and then click Review and Launch. Here we have picked a P3 instance.

Step 3b: Launch your instance

Choose Launch on the Review page.

Step 4: Create a new private key file

If you don’t already have a private key pair, create one by selecting Create a new key pair, and download it to a safe location. Then launch your instance. If your instance fails to launch because of an instance limit, you need to request an increase through the AWS Support Center.

Step 5: Click View Instance to see your instance status

Step 6: Find your instance’s public DNS and copy it

Step 7: Open your command line terminal

In the terminal, use the following commands to change to the directory where your security key is located, then connect to your instance using SSH. (NOTE: Replace text below in red.)


cd /Users/your_username/Downloads/
chmod 0400 <your .pem file name>
ssh -L localhost:8888:localhost:8888 -i <your .pem file name> ubuntu@<Your instance DNS>

Step 8: Open Jupyter

In the terminal, use the command: jupyter notebook

Then copy the URL indicated. 

Step 9: Start a new notebook 

Open a browser window and navigate to the URL indicated in the last step. Choose New and start a new notebook using any popular deep learning framework including TensorFlow, Apache MXNet and Gluon, Torch, PyTorch, Caffe, Caffe2, Keras, Theano, Microsoft Cognitive Toolkit, and Chainer.

Now that you’ve launched the AWS Deep Learning AMI, you can easily run tutorials for computer vision, natural language processing, recommendation systems, and more using the deep learning framework of your choice. Happy modeling!

Learn more:

  • Find out more about using various deep learning frameworks including TensorFlow, Apache MXNet, PyTorch, and more in our Getting Started
  • Use this step-by-step tutorial to activate the TensorFlow framework on the AMIs.
  • Use this step-by-step tutorial to activate the Apache MXNet framework on the AMIs.

Updated March 26, 2018


About the author

Cynthya Peranandam is a Principal Marketing Manager for AWS artificial intelligence solutions, helping customers use deep learning to provide business value. In her spare time she likes to run and listen to music.