/sagemaker-fastai-notebook

Project with AWS CloudFormation templates to provision SageMaker notebooks setup to work with fast.ai

Apache License 2.0Apache-2.0

SageMaker fast.ai notebook

Example project showing how to create a SageMaker notebook instance with the fast.ai library and course notebooks installed.

The notebook is designed to work with either v 0.7 or v 1.0 of the fastai library. v 0.7 should be used if you are taking 2nd edition of Practical Deep Learning For Coders released online in early 2018. v 1.0 should be selected if you are taking the 3rd edition of Practical Deep Learning For Coders that will be released online to the general public early 2019.

Setup

Follow the instructions below to setup your IAM role, SageMaker Notebook Lifecycle Configuration, SNS Topic and SageMaker Notebook Instance.

We will use CloudFormation to create our resources via a template file. To do this,

  1. Click the Launch Template button in the table below selecting the region closest to you. It will open the AWS CloudFormation Web Console a create a new CloudFormation stack. There are a few parameters you will need to fill in including the instance type, fastai library version and email address. The default instance type is ml.p3.2xlarge as this is required to train the fast.ai models quickly. The ml.t2.medium option is part of the AWS Free Tier. See the SageMaker pricing page for more details. Valid options are for the fast.ai library are 0.7 and 1.0. The default option is 1.0. You will need to enter your email address to receive a notification when the fastai environment has been installed correctly. Click through the options and select the SageMaker instance type, the fastai library version and your email address.
Region Launch link
eu-west-1 CloudFormation
us-east-1 CloudFormation
us-east-2 CloudFormation
us-west-2 CloudFormation
ap-northeast-2 CloudFormation
ap-southeast-2 CloudFormation
ap-northeast-1 CloudFormation
eu-central-1 CloudFormation

Take note of the resources created including:

  • IAM service role allowing SageMaker access various AWS services
  • SageMaker Notebook Lifecycle Config scripts that are run when the SageMaker Notebook is created and started.
  • SageMaker Notebook Instance to run the fast.ai MOOC course notebooks.
  • SNS Topic to receive an email notification when the notebook is setup correctly with the fastai library and dependencies.

Screenshot

  1. You will need to confirm the subscription to the SNS topic by checking the inbox of the email address supplied. Click the Confirm subscription link in the email to receive the notification email later.

Screenshot

  1. Wait for up to 15 minutes to have all of the fastai libraries installed on the SageMaker notebook instance. When it has done you will receive an email with a link to the notebook instance as per the screenshot below.

Screenshot

  1. Click on the tinyurl.com based shortened link to open the Jupyter notebook web console.

Screenshot