Getting started with the AWS Deep Learning AMI

June 17, 2017
Twitter: @julsimon Medium: https://medium.com/@julsimon Slideshare: https://fr.slideshare.net/JulienSIMON5 ⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) https://www.buymeacoffee.com/julsimon ⭐️⭐️⭐️ - What is the AWS Deep Learning AMI? - Running the AWS Deep Learning AMI on a GPU instance - Training a Deep Learning model on a GPU with the MNIST dataset

Transcript

Hi everyone. Today I want to show you the Deep Learning AMI and how to quickly get started with deep learning on AWS. The Deep Learning AMI is an Amazon-maintained image that includes all the libraries and tools you need to start building your deep learning projects. It includes popular deep learning frameworks such as TensorFlow, Caffe, MXNet, and more. It also includes additional tools like the Anaconda distribution, and everything you need to run code on GPUs, including NVIDIA drivers, which can be tricky to set up. With this AMI, all you have to do is fire up an instance, wait a few minutes, and get to work. As you can see on our website, this AMI has been updated just 10 days ago with all the latest versions. Let's start one. It's an AMI, so just go to the AWS console and pay attention to where the AMI is available. It's available in the US and in Ireland. Let's start an instance in Oregon for a change. I'll click on the launch instance button, go to the AWS Marketplace, look for the Deep Learning AMI, and there's an Amazon Linux version and an Ubuntu version. Let's start the Ubuntu version. This AMI is free of charge; you only pay for the instance costs. You can run the deep learning AMI on a CPU-based instance. For example, MXNet and other frameworks will run just fine on CPU. Training models will be a little slower than on GPUs, but it definitely works. Of course, we want to play with GPUs, so we recommend using something in the G2 family or in the P2 family. The G2.2xlarge, which I'm going to use, is reasonably cheap. If you want to go big and play with the P2.16xlarge, just make sure you understand the costs. Let's select that one. We don't need to add storage; we have more than we need. We could add a tag here. For the security group, SSH is useful. If you want to use Jupyter notebooks and similar tools, you would have to add the appropriate port for that tool. Let's review and launch it. The fees for the AMI are $0. Key pair and launch it. It's going to launch like any other AMI. I've done this before, so we don't want to wait for the instance to come up. Let's go back to the EC2 console, and I've got an instance running already. Let's grab the domain name and connect with SSH. This is an Ubuntu-based AMI, so you have to use the Ubuntu user. Don't try the EC2 user; that's only for Amazon Linux. We should connect. What do we have here? We have a whole bunch of tools, like I said. I can see Anaconda, Caffe, Keras, MXNet, TensorFlow, Theano, Torch, and more. You have all the sources for these, so if you want to pull from their GitHub repo and rebuild, you can do that. This is a GPU instance, so I should be able to see some GPUs here. There's only one on this instance, but it's good for development and not really expensive. Let's see if MXNet is actually installed. Let's just import it. That seems to work. Check the version. It's 0.10, which is the latest version. As you can see, everything is already in there. No need to mess with the configuration, just get to work. Let's train something here. Let's go to the example directory and image classification. There are a whole bunch of examples in here using ImageNet, MNIST, and CIFAR-10, which are great for learning how to build and train MXNet models. Let's do a quick training on MNIST. I'm going to use Python and run that script here. I want to do this on a GPU, so I'll use the GPUs flag to train on GPUs. As you can see, I'm downloading the dataset, and off it goes. Training pretty fast. This is going for 20 epochs. As you can see, it's all in there. Just fire up the AMI and get to work. We will provide updated versions of the AMI whenever something new shows up, but this is a great time-saver. In less than a minute, I fired up that instance and was able to train a deep learning model on MNIST with decent validation accuracy. You can obviously use it to predict with your own images. This was just a short video to show you how easy it is to fire up the Deep Learning AMI. If you want to learn more about MXNet, you can go to my Medium page where I published a number of MXNet articles which seem to be quite popular. Thanks for reading them. They're a good way to get started with MXNet and deep learning. Feel free to get in touch if you have questions. I hope this was informative, and see you next time.

Tags

Deep Learning AMIAWSGPU InstancesMXNetJupyter Notebook