Learn how to serve machine learning model using AWS SageMaker and the Python Boto3 library.
In my previous articles, we used different technology stacks to serve the machine learning model. E.g.,
- Serving Machine Learning Models (DCGAN, PGAN, ResNext) using FastAPI and Streamlit
- Serving ML Model using GraphQL Subscription
- Serverless Machine Learning APIs using Lambda and EFS
- Build a Web-based Object Detection System using YOLO
In this article, let’s start to explore AWS SageMaker. We will provision a notebook instance using AWS CDK, use a sample notebook for training and testing, serve a model endpoint and subsequently invoke the model endpoint using Boto3.
Provision A SageMaker Notebook Instance
Let’s start by provisioning a SageMaker notebook instance using AWS CDK. If you not familiar with Infrastructure As Code (IaC), do check out this article.
- I am going to use the below code snippet to provision the VPC, S3 bucket, and SageMaker notebook instance.
cdk deployto deploy the stack.
- Once the operation is completed successfully, you should see the notebook instance in AWS Console.