SMSIG
tensorflow
config_error
ai_generated
true
ValueError: Signature key 'serving_default' not found in SavedModel. Available keys: ['train', 'eval']. Check the model export configuration.
ID: tensorflow/savedmodel-signature-key-error
90%Fix Rate
87%Confidence
1Evidence
2023-08-05First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| tensorflow==2.10.0 | active | — | — | — |
| tensorflow==2.12.0 | active | — | — | — |
| tensorflow==2.15.0 | active | — | — | — |
Root Cause
The SavedModel was exported with only training and evaluation signatures, lacking the default serving signature required for inference.
generic中文
SavedModel仅导出训练和评估签名,缺少推理所需的默认服务签名。
Official Documentation
https://www.tensorflow.org/guide/saved_modelWorkarounds
-
95% success Re-export the model with `tf.saved_model.save` and include a serving signature by specifying `signatures` parameter with a concrete function.
Re-export the model with `tf.saved_model.save` and include a serving signature by specifying `signatures` parameter with a concrete function.
-
85% success Use `model.save('model.h5')` to save in HDF5 format and then convert to SavedModel with the correct signatures using `tf.keras.models.load_model` and `tf.saved_model.save`.
Use `model.save('model.h5')` to save in HDF5 format and then convert to SavedModel with the correct signatures using `tf.keras.models.load_model` and `tf.saved_model.save`.
中文步骤
Re-export the model with `tf.saved_model.save` and include a serving signature by specifying `signatures` parameter with a concrete function.
Use `model.save('model.h5')` to save in HDF5 format and then convert to SavedModel with the correct signatures using `tf.keras.models.load_model` and `tf.saved_model.save`.
Dead Ends
Common approaches that don't work:
-
95% fail
Reinstalling TensorFlow does not affect the SavedModel content; the issue is in the export process.
-
85% fail
Changing the input data shape does not add missing signatures; it only affects the data passed to existing signatures.