Closed azagniotov closed 4 years ago
Predict API uses TensorProto as its input/output type. Protocol buffers (like ELWC you are referring to here) are passed in serialized form as DT_STRING typed tensors.
Further, the REST Predict API mimics the gRPC API. This API takes PredictRequest
protocol buffer as its input, defined here: https://github.com/tensorflow/serving/blob/3a0bdbe5c216e4eeab8110cad8d959d21a2e376a/tensorflow_serving/apis/predict.proto#L12-L21
As you see, this request takes a TensorProto
as its input.
So Predict API does not/cannot treat ExampleListWithContext
protobuf differently like Classify/Regress methods do, and you need to serialize and pass such protos as DT_STRING tensors. Predict API is designed to be agnostic to specific protocol buffers (by design), to allow the freedom to pass any arbitrary protobufs.
I am going to close this feature request because it is at odds with the Predict API design.
Hi @netfs ,
Thank you for your input and confirming that Predict API is designed to be agnostic to specific protocol by design.
Please go to Stack Overflow for help and support:
https://stackoverflow.com/questions/tagged/tensorflow-serving
If you open a GitHub issue, here is our policy:
Here's why we have that policy: TensorFlow developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.
Feature Request
System information
tensorflow-serving-api
==2.0.0tensorflow
==2.0.0tensorflow-ranking
==0.2.0Disclaimer
I am not sure if the following is a bug, therefore I am listing this under a feature request
Describe the problem the feature is intended to solve
I am trying to
POST
anELWC
(ExampleListWithContext) to thepredict
REST API.Based on what I see at https://www.tensorflow.org/tfx/serving/api_rest , the request body format for the
classify
andregress
APIs supports theELWC
structure formatted as JSON. Yet, thepredict
API does not support the same JSON format forELWC
.In order for me to make a successful request with the
ELWC
topredict
API, I need to first serialize & base64 encode theELWC
proto and then make a request topredict
API using a cURL request that looks as follows:the cURL (the
serialized_elwc_proto_base64
holds theCqABCp0BCiQK...
):We can be a little more descriptive by specifying the
signature_name
and thereceiver_name
(whatever was defined when creatingserving_input_receiver_fn
):For context, full discussion: https://github.com/tensorflow/ranking/issues/189
Question
Why does
predict
REST API does not support the same request body format for ELWC, just likeclassify
®ress
do? Is this by design or an overlook (i.e.: bug). If this is by design, what is the rationale behind this decision?Describe the solution
Ability to make request to
predict
REST API with a request body as a JSON object formatted as follows:Additional context
https://github.com/tensorflow/ranking/issues/189