0
votes

I am training a DNNLinearCombinedClassifier and serving it for low latency predictions through tensorflow-serving. The current serving signature expects a serialized tf.example.

I want to be able to export the same model with multiple serving_fn, since I want to change the expected data format.

I cannot use the ServingInputReceiver receiver_tensors_alternatives because I need to apply slightly different transformation to my features depending on the provided data format. These transformations are mostly reshaping my features.

Is there any way to export a model providing multiple different ServingInputReceivers?

1
Why not use tf.keras and tf.keras.layers.experimental.preprocessing - DachuanZhao
Hello. Can you expand a little bit on how tf.keras.layers.experimental.preprocessing can be used here? - Martin Bomio
You don't have to create an input function for serving if you use that . - DachuanZhao
You can use tf.keras.Input + tf.keras.layers.experimental.preprocessing to replace input_fn . - DachuanZhao

1 Answers

0
votes

IIUC, you want two different signatures for the same model, and you want to apply different transformations for the input for each signature, correct? You could do this in the serving code, but you want to make sure that you apply the same transforms during training, and trying to duplicate the code in two places opens the door for training/serving skew.

One option is to branch your TFX pipeline, so that you have two Transforms feeding two Trainers, with different transformations being prepended to your models.