Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I invoke a Amazon SageMaker endpoint with the Python SDK

I'm trying to use this very simple command:

import boto3 client = boto3.client('sagemaker-runtime')

listed in the documentation

but i'm getting this error:

UnknownServiceError: Unknown service: 'sagemaker-runtime'. Valid service names are: acm, etc..

My goal is to be able to invoke the endpoint that I've created in Amazon SageMaker.

I'm doing this from a Jupyter notebook in Sagemaker, so I feel like this should work no problem. How do I get it to run here, and outside of the Sagemaker environment?

like image 826
tlanigan Avatar asked Jan 20 '26 15:01

tlanigan


1 Answers

Amazon SageMaker is a very new service (December 2017).

You will need to update your boto library to use it:

sudo pip install boto --upgrade
sudo pip install boto3 --upgrade
sudo pip install awscli --upgrade
like image 107
John Rotenstein Avatar answered Jan 23 '26 03:01

John Rotenstein