SavedModel missing serving_default signature after Keras model export in TensorFlow 2.x
0 reputation · 28 Apr 2020, 07:32 UTC
When a Keras model is exported with model.save() in TensorFlow 2.x, the resulting SavedModel directory may lack a concrete function under the serving_default signature key that TensorFlow Serving expects. The goal is to confirm that the exported model contains a signature with defined input names and shapes that match the production request format, especially when preprocessing is performed outside the model graph.
Uncertainty arises because the signature is generated during graph tracing (tf.function) and can be affected by batch size, sequence length, or the presence of Python‑side preprocessing that is not serialized into the SavedModel. Additionally, version skew between the training TensorFlow version and the TensorFlow Serving binary can prevent the signature from being recognized.
- Does the SavedModel produced by
model.save()contain aserving_defaultsignature with the expected input and output tensor names? - How does the tracing of input shapes (e.g., fixed batch size) affect compatibility with variable‑sized production requests?
- What version relationship between the TensorFlow used for export and the TensorFlow Serving runtime is required to guarantee the signature is loadable?