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

Keras code example for TF serving #424

Closed
dimitreOliveira opened this issue Sep 18, 2022 · 13 comments
Closed

Keras code example for TF serving #424

dimitreOliveira opened this issue Sep 18, 2022 · 13 comments

Comments

@dimitreOliveira
Copy link

Hey there, I would be happy to write a Keras code example showcasing how to server Keras models using TF serving, let me know if you think that this would be useful, if yes it would be awesome if you can mention if you like to see something specific like serving vision, text, multiple models, or if just a minimal example would be fine.

@tilakrayal
Copy link
Collaborator

@dimitreOliveira,
Could you please take a look at this official doc link and confirm if you are looking for the similar information? Thank you!

@dimitreOliveira
Copy link
Author

Hi @tilakrayal , thanks for the reference, but I am actually offering to write a "Keras code example" on how to do that with different use cases that might be helpful for new users, what I would like to know is if the Keras team thinks that this could be a good addition or if it wouldn't add to much here.

@gowthamkpr
Copy link
Contributor

@dimitreOliveira Can you please let us know what usecases are you proposing? Thanks!!

@dimitreOliveira
Copy link
Author

Hi @gowthamkpr ,

Since the code examples are usually small I have two ideas of how it could go:

  • Option 1: A two parts example where first I talk about TFServing, some best practices, etc and show how to serve a simple model (could be a vision model), in the second part I show how to create a custom signature that allows the user to embed the preprocessing and postprocessing logic and then serve the model with it, this is to showcase some of the advantages of TFServing.
  • Option 2: The code example would be a collection of different types of models being served with TFServing, vision model, text model, structured data model, maybe a GAN or some forest mode, could be anything just to show its flexibility.

Do you think that any of those ideas would turn into good code examples?

@innat
Copy link

innat commented Sep 23, 2022

It would be great fit for https://keras.io/examples/keras_recipes/
cc. @fchollet

@haifeng-jin
Copy link
Member

Does these all fit into a Colab notebook?

@haifeng-jin
Copy link
Member

https://www.tensorflow.org/tfx/tutorials/serving/rest_simple
@dimitreOliveira
Will the contributed tutorial different from this one?

@dimitreOliveira
Copy link
Author

Hi @haifeng-jin , yes option 1 would be similar to that with some additional information about model signatures, I believe that it could fit well into a notebook. Another advantage is that we would have an example of that on the Keras code example page, it could be easier for new users to find it. Let me know if you think that it would be a good addition.

@PierrickPochelu
Copy link

Why use keras if you can use more dedicated inference frameworks such as tensorrt, openvino, onnx-runtime, TF ...

@dimitreOliveira
Copy link
Author

I am not quite sure of what you mean here, but my idea is to create an example of serving Keras models with TFServing, both of them belong to the TensorFlow ecosystem.

@haifeng-jin
Copy link
Member

@dimitreOliveira
Thank you!
Wait for @fchollet comment before you start.

@fchollet
Copy link
Member

fchollet commented Oct 5, 2022

Hi Dimitre,

Thanks for offering to write an example on TFServing + Keras, I think it would be valuable. You can just open a PR on https://github.com/keras-team/keras-io. I agree that option 1 (focus on best practices) is more helpful.

@dimitreOliveira
Copy link
Author

Awesome, thank you very much guys, I will start working on this next week.

@fchollet fchollet transferred this issue from keras-team/keras Sep 22, 2023
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

7 participants