Skip to content

SDK 2.0: deploy() returns NoneType #1749

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

Closed
juliensimon opened this issue Jul 24, 2020 · 5 comments
Closed

SDK 2.0: deploy() returns NoneType #1749

juliensimon opened this issue Jul 24, 2020 · 5 comments
Assignees

Comments

@juliensimon
Copy link

Using the latest SDKv2 build:

from sagemaker.model import Model

tf_model = Model(
    image_uri="763104351884.dkr.ecr.us-east-1.amazonaws.com/tensorflow-inference:2.1.0-cpu",
    model_data=model_path,
    role=role)

tf_predictor = tf_model.deploy(
                 initial_instance_count=1, 
                 instance_type='ml.m5.large',
                 endpoint_name=tf_endpoint_name)

# the endpoint is created correctly

type(tf_predictor)
NoneType

This should return a sagemaker.predictor.Predictor object, right? Have I missed something?

@juliensimon
Copy link
Author

For the record, replacing Model with TensorFlowModel works fine

from sagemaker.tensorflow.model import TensorFlowModel

tf_model = TensorFlowModel(
    model_data=model_path,
    framework_version='2.1.0',
    role=role)

@laurenyu
Copy link
Contributor

the generic Model class doesn't have a default predictor class associated with it: https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/model.py#L66

for TF specifically, sagemaker.tensorflow.serving.Model has now become sagemaker.tensorflow.model.TensorFlowModel

@juliensimon
Copy link
Author

ok, got it. Definitely worth mentioning in the doc :)

@laurenyu
Copy link
Contributor

I've updated the docs in #1756. Thanks for bringing this up!

@Mahdi-Hosseinali
Copy link

I was just wondering why my model does not return a predictor that I can use in the notebook until I found this. I used this document page:
https://sagemaker.readthedocs.io/en/stable/api/inference/model.html
I used the artifacts to load my model so this page is all I needed. Could not figure out deploy returns None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants