尝试从使用Java的托管tf savemodelbundle格式模型获取分数时遇到异常

时间:2018-09-25 18:18:10

标签: java tensorflow-serving

尝试从托管的tf savemodelbundle格式模型获取分数时出现异常。 我正在使用grpc版本1.1.2。

例外是

io.grpc.StatusRuntimeException: INTERNAL: tensorflow.serving.PredictionService/Predict: INTERNAL: Expected prediction signature method_name to be one of {tensorflow/serving/predict, tensorflow/serving/classify, tensorflow/serving/regress}. Was: 
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:227)
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:208)
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:141)
at tensorflow.serving.PredictionServiceGrpc$PredictionServiceBlockingStub.predict(PredictionServiceGrpc.java:287)

我的请求如下:

ModelSpec theModelSpec = ModelSpec.newBuilder().setName("export").setSignatureName("serving_default").build();   
tensorflow.serving.Predict.PredictRequest.Builder theRequestBuilder = PredictRequest.newBuilder().setModelSpec(theModelSpec).putInputs("input", createTensorProto(values));

我知道我缺少一些参数。 任何线索都将有所帮助。谢谢!

0 个答案:

没有答案