从Tensorflow服务服务器获取StatusCode.FAILED_PRECONDITION:未找到服务签名密钥“ tensorflow / serving / predict”

时间:2018-10-26 13:20:40

标签: python tensorflow tensorflow-serving

尝试连接到TF服务服务器时,我的python grpc客户端出现以下错误:

<_Rendezvous of RPC that terminated with:
status = StatusCode.FAILED_PRECONDITION
details = "Serving signature key "tensorflow/serving/predict" not found."
debug_error_string = "{"created":"@1540559424.720048798","description":"Error received from peer","file":"src/core/lib/surface/call.cc","file_line":1099,"grpc_message":"Serving signature key "tensorflow/serving/predict" not found.","grpc_status":9}"
>

我相信这意味着当我构建可服务对象时,方法名称是错误的。但是我看到在可服务的模型构建器脚本中,我使用的是正确的名称。

prediction_signature = tf.saved_model.signature_def_utils.build_signature_def(
        inputs=input_signature,
        outputs=output_signature,
        method_name=tf.saved_model.signature_constants.PREDICT_METHOD_NAME)

    builder = saved_model_builder.SavedModelBuilder(os.path.join(output_path, str(version_number)))

在客户端出现此错误的原因是什么?

0 个答案:

没有答案