Setting up an Azure VM for Deep learning

Abhik Mitra
Dec 24, 2016 · 3 min read

So I just started with the course at http://course.fast.ai/ called Practical Deep Learning For Coders. The basic infrastructure that you need is a GPU enabled PC so that you can train your models on the images quickly. The Author has described how to do it in AWS , but the problem with AWS GPU instances are that is still in some sort of preview and we need to contact Amazon Support for unlocking their P2 Instances.

Microsoft Azure on the other hand already has GPU enabled VMs which came out of preview on 1st of December 2016. You can see the promo page here . Its now out of preview and anyone can access it without going through the hassle of contacting support. You can see the pricing here . The NC6 Machines that we are gonna use costs 0.90$ per hour.

If you are new to Azure, I hope the screenshots will help you. Login to https://ms.portal.azure.com with your Microsoft/Live account. The click on the + sign to add a VM

Image for post
Image for post

Search for Ubuntu Server 16.04 LTS as above.

Image for post
Image for post
Make Sure you choose resource Manager in this step
Image for post
Image for post
Configure the settings. Name the machine ubuntu

Make sure you choose the Vm disk type as HDD instead of SSD as otherwise it will not show you the NC6 option . Also the location has to be East US.

Image for post
Image for post

By default it shows recommended VMs, click on all and scroll down to NC6.

Image for post
Image for post

You should see the above message once it is successful

Image for post
Image for post

Once it is ready, click on connect and you will be able to see the IP.


Once you ssh into the machine.Start running the following commands from your home folder . I have made a gist as seen below. Please run the commands one by one as in the blog.

Run step 1 from this gist. You might see an error like the one below

Image for post
Image for post
Error in last 2 lines

So we have to re run the last 4 lines from the install-gpu-azure script. So Run step 2 from the gist.

No we are almost ready to start with out jupyter notebook. So please execute step3_from_your_local in your local system. So this will tunnel traffic from your localhost:8000 to the VM 8888 port. replace the Ip with your own ip

Now run step 4 form the gist and get all the resources you need.


Now we open the notebook and navigate lesson1. And start executing each of the commands

Image for post
Image for post

You should get this error. We need cv2 . Please run Step 5 from the gist and you should be good.

Everything should be fine and dandy now :) . Happy deep Learning!

Image for post
Image for post
It works!

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store