VOOZH about

URL: https://thenewstack.io/take-amazon-sagemaker-studio-lab-for-a-spin/

⇱ Take Amazon SageMaker Studio Lab for a Spin - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2021-12-20 04:00:50
Take Amazon SageMaker Studio Lab for a Spin
analysis,sponsor-palo-alto-networks,sponsored-event-coverage,
Software Development

Take Amazon SageMaker Studio Lab for a Spin

In this tutorial, we will walk you through the steps of training an end-to-end deep learning model to perform image classification based on Amazon SageMaker Studio Lab.
Dec 20th, 2021 4:00am by Janakiram MSV
👁 Featued image for: Take Amazon SageMaker Studio Lab for a Spin
Palo Alto Networks sponsored this post.

Introduced  as a preview at the Amazon Web Services‘ re:Invent 2021 conference, SageMaker Studio Lab is a free stand-alone machine learning development environment based on the popular JupyterHub IDE.  Except for the branding, the service has almost nothing to do with SageMaker. For a detailed overview of the service, read my previous article.

In this tutorial, I will walk you through the steps of training an end-to-end deep learning model to perform image classification based on Amazon SageMaker Studio Lab. We will build a model that distinguishes between cats and dogs (Be sure to check back all this week for additional SageMaker Studio Lab tutorials).

Step 1: Request Access and Sign In

Visit https://studiolab.sagemaker.aws/ to request a free Amazon SageMaker Studio Lab account.

👁 Studio lab landing page

👁 request account

It may take a few hours to a couple of days for you to get access to the environment. Wait for the email confirmation.

👁 account ready

Once approved, sign in to your account with the credentials.

👁 sign in

Select GPU compute type, and click on the Start runtime button.

👁 start runtime

When the runtime is ready, click on Open project.

👁 Open project

The JupyterHub environment is ready for experimentation.

👁 Ready for experimentation

Step 2: Preparing the Environment

From the launcher, click on the terminal icon to start a new terminal session. Clone the Git repository that has the Conda environment configuration and the notebooks.

git clone https://github.com/janakiramm/dogs-vs-cats

Navigate to the the dogs-vs-cats folder, and right click on env_tf2.yaml file to create a new Conda environment. This file has all the modules needed to train a TensorFlow/Keras model.

👁 Pull in variables

Prisma Cloud delivers the industry’s broadest security and compliance coverage—for applications, data, and the entire cloud native technology stack—throughout the development lifecycle and across multi- and hybrid-cloud environments.
Learn More
The latest from Prisma by Palo Alto Networks

👁 Studio lab environ

Refresh the browser to see a new kernel named tf2:Python

👁 New kernel

Before we can start training the model, we need to download the dataset. For this, login to Kaggle and download the file train.zip from the Dogs vs. Cats competition.

👁 Download the dataset

Upload the file, train.zip into the dataset folder of the repo that we cloned in the previous step. Launch a terminal session and unzip the file in the same folder. You should now have a new folder — /dogs-vs-cats/dataset/train/.

We now have the environment fully configured to kickoff the training job within Amazon SageMaker Studio Lab.

Step 3: Train the Computer Vision Model to Classify Images

Navigate to the train folder of the repository and launch dogs-vs-cats.ipynb notebook.

👁 Train the model to classify images

If prompted for the kernel, choose tf2:Python.

👁 select the kernel

This notebook loads the dataset we downloaded and trains the image classification model. Run the cells to complete the training. It may take up to 15 minutes for the training to complete.

In my experiment, the model was trained with an accuracy of 87.5%. This may be improved by increasing the number of epochs.

👁 Training the model

When the model is ready, it is exported to the model/export/Servo/1 directory in the TensorFlow Serving format.

👁 Export the model

Step 3: Perform Inference on the Trained Model

Navigate to the infer folder to open the inference notebook. We load the saved model from /model/export/Servo/1/ and use it for inference.

model = tensorflow.keras.models.load_model("../model/export/Servo/1/")

When an image is appropriately resized and preprocessed, it can be sent to the model. Below are the screenshots predicting the correct classes.

👁 Perform inference

👁 More inference training

You can easily upload the model to Amazon S3 using the Python Boto3 module to deploy it in Amazon SageMaker.

In the next part of this series — which will run all this week — we will utilize the image classification model to create a serverless inference endpoint in Amazon SageMaker. Stay tuned.

Prisma Cloud delivers the industry’s broadest security and compliance coverage — for applications, data, and the entire cloud native technology stack — throughout the development lifecycle and across multi- and hybrid-cloud environments.
Learn More
The latest from Palo Alto Networks
TRENDING STORIES
Janakiram MSV (Jani) is a practicing architect, research analyst, and advisor to Silicon Valley startups. He focuses on the convergence of modern infrastructure powered by cloud-native technology and machine intelligence driven by generative AI. Before becoming an entrepreneur, he spent...
Read more from Janakiram MSV
Palo Alto Networks sponsored this post.
SHARE THIS STORY
TRENDING STORIES
Amazon Web Services is a sponsor for The New Stack.
TNS owner Insight Partners is an investor in: Pragma.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.