首页 > 解决方案 > 从 Tensorflow 服务服务器获取 StatusCode.FAILED_PRECONDITION:未找到服务签名密钥“tensorflow/serving/predict”

问题描述

尝试连接到 tf-serving 服务器时,从我的 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)))

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

标签: pythontensorflowtensorflow-serving

解决方案


推荐阅读