I have got a trained Tensorflow model and I want to serve the prediction method with REST API. What I can think of is to use Flask to build a simple REST API that receive JSON as input and then call the predict method in Tensorflow and then return the predicted result to the client side.
I would like to know is there any concern to do it this way especially in production environment?
Many thanks!
Machine learning is a process that is widely used for prediction. N number of algorithms are available in various libraries which can be used for prediction.
The first concern which comes into my mind is the performance.
TensorFlow team seems to have worked out server/client usage. You may want to look into tensorflow serving. As a default, it uses gRPC for communication protocol.
We use Flask + TensorFlow serving at work. Our setup might not be the most optimal way to serve models, but it gets the job done and it works fine for us so far.
The setup is the following:
The good thing here is that the model is not served by the Flask API application. The docker image model server can easily be replaced with a model server running on a GPU compiled for the machines hardware instead of the docker container.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With