{“错误":“服务签名名称:" serving_default";在签名def中找不到" } [英] { "error": "Serving signature name: "serving_default" not found in signature def" }
问题描述
我使用GCP(谷歌云平台)来训练我的模型,并且可以导出导出的模型.我使用了该模型并使用了Tensorflow服务1.8 CPU的本地docker镜像,我得到了以下结果作为REST调用的输出 { 错误":在签名定义中找不到服务签名名称:\" serving_default \ }
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" }
推荐答案
使用SavedModelCLI
命令查看模型的SignatureDef,如下所示:
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
检查是否可以在上面的签名定义中看到名为serving_default
的签名.
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.
这篇关于{“错误":“服务签名名称:" serving_default";在签名def中找不到" }的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!