{ “error”: “Serving signature name: ”serving_default“ not found in signature def” }

蓝咒 提交于 2019-12-24 12:26:40

问题


I used GCP(google cloud platform) to train my model and I could export the exported model. I used the model and used a local docker image of Tensorflow serving 1.8 CPU and i get the following result as output for REST post call { "error": "Serving signature name: \"serving_default\" not found in signature def" }


回答1:


View the SignatureDefs of your model using SavedModelCLI command as shown below:

saved_model_cli show --dir /usr/local/google/home/abc/serving/tensorflow_serving/servables/tensorflow/testdata/saved_model_half_plus_three/00000123

It should show something like shown below:

signature_def['Classify']:
  The given SavedModel SignatureDef contains the following input(s):
    inputs['inputs'] tensor_info:
        dtype: DT_STRING
        shape: unknown_rank
        name: tf_example:0
  The given SavedModel SignatureDef contains the following output(s):
    outputs['outputs'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 1)
        name: y2:0
  Method name is: tensorflow/serving/regress

signature_def['serving_default']:
  The given SavedModel SignatureDef contains the following input(s):
    inputs['x'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 1)
        name: x:0
  The given SavedModel SignatureDef contains the following output(s):
    outputs['y'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 1)
        name: y:0
  Method name is: tensorflow/serving/predict

Check if you can see the Signature named serving_default in the above Signature Definitions.

Most probably, as per my understanding, that signature is missing and hence it is resulting in Error.




回答2:


How did you export your model? Seemes that you have identified a custom signature but not the default value. Just change "serving_default" to your signature would be fine.



来源:https://stackoverflow.com/questions/56234858/error-serving-signature-name-serving-default-not-found-in-signature-def

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!