Data processing while using tensorflow serving (Docker/Kubernetes)

10/19/2019

I am looking to host 5 deep learning models where data preprocessing/postprocessing is required.

It seems straightforward to host each model using TF serving (and Kubernetes to manage the containers), but if that is the case, where should the data pre and post-processing take place?

-- echan00
docker
kubernetes
tensorflow-serving

2 Answers

10/20/2019

I'm not sure there's a single definitive answer to this question, but I've had good luck deploying models at scale bundling the data pre- and post-processing code into fairly vanilla Go or Python (e.g., Flask) applications that are connected to my persistent storage for other operations.

For instance, to take the movie recommendation example, on the predict route it's pretty performant to pull the 100 films a user has watched from the database, dump them into a NumPy array of the appropriate size and encoding, dispatch to the TensorFlow serving container, and then do the minimal post-processing (like pulling the movie name, description, cast from a different part of the persistent storage layer) before returning.

-- josephkibe
Source: StackOverflow

10/20/2019

Additional options to josephkibe's answer, you can:

  1. Implementing processing into model itself (see signatures for keras models and input receivers for estimators in SavedModel guide).

  2. Install Seldon-core. It is a whole framework for serving that handles building images and networking. It builds service as a graph of pods with different API's, one of them are transformers that pre/post-process data.

-- Nikita Makarov
Source: StackOverflow