Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load endpoint? #36

Closed
yash1 opened this issue Jan 2, 2018 · 2 comments
Closed

Load endpoint? #36

yash1 opened this issue Jan 2, 2018 · 2 comments

Comments

@yash1
Copy link

yash1 commented Jan 2, 2018

Hi,

How can you load an existing endpoint after you've deployed it for predictions?
The notebook example I've seen show end to end training to deployment but what if you want to reuse a previous model just to make predictions?

@winstonaws
Copy link
Contributor

winstonaws commented Jan 3, 2018

If you have an existing endpoint, you just need to create a Predictor object and provide it your endpoint name. This will give you an object that is the same as the object created by the Estimators in the end-to-end examples. Then, simply call its predict() method.

You can either use the generic RealTimePredictor class, which does not do any serialization/deserialization logic on your input, but can be configured to do so through constructor arguments:
http://sagemaker.readthedocs.io/en/stable/predictors.html

Or you can use the TensorFlow / MXNet specific predictor classes, which have default serialization/deserialization logic:
http://sagemaker.readthedocs.io/en/stable/sagemaker.tensorflow.html#tensorflow-predictor
http://sagemaker.readthedocs.io/en/stable/sagemaker.mxnet.html#mxnet-predictor

Example code using the TensorFlow predictor:

from sagemaker.tensorflow import TensorFlowPredictor

predictor = TensorFlowPredictor('myexistingendpoint')
result = predictor.predict(['my request body'])

@winstonaws
Copy link
Contributor

Added answer to the FAQ on our README as well. Please reopen if you have further questions.

laurenyu pushed a commit to laurenyu/sagemaker-python-sdk that referenced this issue May 31, 2018
apacker pushed a commit to apacker/sagemaker-python-sdk that referenced this issue Nov 15, 2018
athewsey pushed a commit to athewsey/sagemaker-python-sdk that referenced this issue Jul 16, 2021
Fix XGBoostProcessor and add TF integration test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants