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

TensorflowModel & gRPC #1472

Closed
ratulray opened this issue May 7, 2020 · 3 comments
Closed

TensorflowModel & gRPC #1472

ratulray opened this issue May 7, 2020 · 3 comments

Comments

@ratulray
Copy link

ratulray commented May 7, 2020

With reference to this comment explaining the difference between TensorflowModel and Model, I can not find the implementation of the server side code for TensorflowModel (the github links given are broken).
I see that tf_container/serve.py was removed in the following change:
aws/sagemaker-tensorflow-training-toolkit@12fd7ef
And I can not find where the latest container-side implementation lies in github.

Similarly it'll be useful to be able to check out container-side implementation corresponding to older container/sagemaker/serve.py.

The reason I'm asking is:
I want to be able to export a model with build_parsing_serving_input_receiver_fn (which expects a serialized tf.Example while serving) and this doesn't work well with TF REST api as it's not possible to put raw bytes into JSON payload. So, it works with TensorflowModel and not with Model (example). But I don't understand why we can not use py3 with TensorflowModel as TensorFlow serving api library supports both py2 & py3.
Ideally I would like to do something like what this example does, sending a serialized gRPC request (e.g. PredictionRequest proto) directly from client, but can not figure out how to do that cleanly (and hopefully without involving py2).

@nadiaya
Copy link
Contributor

nadiaya commented May 8, 2020

The old TensorflowModel as well as the image have been deprecated and no longer getting updated. It doesn't support py3 because the official corresponding version of TensorFlow Serving did not support py3 at the time.

Here is the latest serving container implementation which just uses TF serving and isn't bound to any python version: https://github.com/aws/sagemaker-tensorflow-serving-container/

And the actual serving files: https://github.com/aws/sagemaker-tensorflow-serving-container/tree/master/docker/build_artifacts/sagemaker

It's actually more flexible than old implementation and you can do both REST and gRPC requests. Here is the documentation on how to use it:
https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/tensorflow/deploying_tensorflow_serving.rst#deploying-to-tensorflow-serving-endpoints

@nadiaya
Copy link
Contributor

nadiaya commented May 8, 2020

@laurenyu
Copy link
Contributor

closing due to inactivity

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