This step-by-step tutorial will help guide you though creating a model using Amazon SageMaker and importing it to an AWS DeepLens model. AWS DeepLens is a fully programmable video camera that comes with tutorials, code, and pre-trained models designed to expand deep learning skills.
You will need an AWS DeepLens device in order to complete this tutorial. You can pre-order now on amazon.com.
Open the AWS Management Console in a new browser window, so you can keep this step-by-step guide open. When the screen loads, enter your user name and password to get started. Then type SageMaker in the search bar and select Amazon SageMaker to open the console.
a. Launch an Amazon SageMaker notebook by selecting Create notebook instance in the Get started section on the right side of the screen.
b. Under the Notebook instance settings section complete the following steps: 1) Give your notebook a name (for example, “HotDogDetection”), 2) Select a Notebook instance type (for example, ml.t2.medium, which is the smallest and lower cost), and 3) Select Create a new role.
c. On the Create an IAM role screen, under S3 buckets you specify - optional, select None. Keep all the other default values as is to allow SageMaker related buckets and objects to be accessed. Select Create role.
d. Back on the Create Notebook instance screen, select the IAM role that you just created in step 2.c. and then select Create notebook instance. The other values for VPC and KMS are not necessary for this simple tutorial, but should be used when using real private data.
e. Return to Amazon SageMaker Console, wait for the notebook status to turn from Pending to InService and select Open.
a. Once the Jupyter notebook is open, select New and then Terminal, to open a new terminal to retrieve the tutorial notebook. You will use the tutorial notebook to a custom model.
b. Now, you will retrieve the notebook from the git repository. In the terminal, change to the SageMaker directory by entering: cd SageMaker . Next, clone the repository from GitHub by entering: git clone https://github.com/aws-samples/reinvent-2017-deeplens-workshop.git
c. Return to the Jupyter Home screen and navigate to the notebook by selecting the reinvent-2017-deeplens-workshop folder.
d. In the folder, navigate to the lab session 3 folder, and select the notebook named deeplens-hotdog-or-not-hotdog.ipynb.
f. Name the bucket with the deeplens-sagemaker- prefix, to allow AWS DeepLens and Amazon SageMaker to access it, and append it with your name for uniqueness. Under Region, select US East (N. Virginia), to align with the notebook region, and select Create in the bottom left corner.
g. Next, scroll down the notebook cells to the cell with the S3 Bucket name, and assign the name of the S3 bucket you created (for example, deeplens-sagemaker-myname), and from the Cell menu at the top of the Jupyter page select the option Run all.
b. In the Import source section, select Externally trained model, and under Model settings, point to the S3 Bucket you created and the folder that was used to output the model (for example, S3://deeplens-sagemaker-myname/test/). Give it a name (for example, Hotdog-or-not) and a description, then select Import.
c. To verify the model import, navigate to the Models page. The newly created model should appear in the list of available models, after the list of the built-in models. The model is ready now to be included in a project and deployed to your device.
You have created your first model using Amazon SageMaker and imported it to an AWS DeepLens model!
You can now include this in a project alongside an AWS Lambda function, and deploy it to the camera for local inference.