Model {quot;error";:“服务签名名称:”在签名定义中未找到“服务默认值”}

Model {quot;error";:“服务签名名称:”在签名定义中未找到“服务默认值”},model,google-cloud-platform,predict,tensorflow-serving,Model,Google Cloud Platform,Predict,Tensorflow Serving,我使用GCP(谷歌云平台)来训练我的模型,我可以导出导出的模型。我使用了该模型,并使用了Tensorflow的本地docker映像,该映像服务于1.8CPU,我得到以下结果作为REST post调用的输出 { “错误”:“服务签名名称:\“服务\u默认值\”未在签名定义中找到” }您是如何导出模型的? 似乎您已识别自定义签名,但未识别默认值。只需将“默认服务”更改为您的签名即可。使用SavedModelCLI命令查看您模型的SignatureDefs,如下所示: saved_model_cli

我使用GCP(谷歌云平台)来训练我的模型,我可以导出导出的模型。我使用了该模型,并使用了Tensorflow的本地docker映像,该映像服务于1.8CPU,我得到以下结果作为REST post调用的输出 { “错误”:“服务签名名称:\“服务\u默认值\”未在签名定义中找到”
}您是如何导出模型的?
似乎您已识别自定义签名,但未识别默认值。只需将“默认服务”更改为您的签名即可。

使用
SavedModelCLI
命令查看您模型的SignatureDefs,如下所示:

saved_model_cli show --dir /usr/local/google/home/abc/serving/tensorflow_serving/servables/tensorflow/testdata/saved_model_half_plus_three/00000123
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
它应该显示如下所示的内容:

saved_model_cli show --dir /usr/local/google/home/abc/serving/tensorflow_serving/servables/tensorflow/testdata/saved_model_half_plus_three/00000123
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
检查是否可以在上述签名定义中看到名为
的签名

根据我的理解,最有可能的是,该签名缺失,因此导致错误