Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support multiple named tensors in seldon protocol and seldon-core client #2049

Closed
chengcheng-pei opened this issue Jun 29, 2020 · 1 comment
Labels
triage Needs to be triaged and prioritised accordingly

Comments

@chengcheng-pei
Copy link
Contributor

chengcheng-pei commented Jun 29, 2020

I have data like:
[{
e_input: ...,
e_time_input: ...,
r_input: ...
}]

I can use tensorflow protocol and send the requests like:

channel = grpc.insecure_channel('{host}:{port}'.format(host="tf-grpc.stage.mycompany.net", port=80))
stub = prediction_service_pb2_grpc.PredictionServiceStub(channel)
tfrequest = predict_pb2.PredictRequest()
tfrequest.model_spec.name = 'classifier'
ind = 0
tfrequest.inputs["e_input"].CopyFrom(make_tensor_proto(d2[ind]["e_input"], dtype=types_pb2.DT_FLOAT, shape=[1, 10]))
tfrequest.inputs["e_time_input"].CopyFrom(make_tensor_proto(d2[ind]["e_time_input"], dtype=types_pb2.DT_FLOAT, shape=[1, 100]))
tfrequest.inputs["r_input"].CopyFrom(make_tensor_proto(d2[ind]["r_input"], dtype=types_pb2.DT_FLOAT, shape=[1, 58]))
result = stub.Predict(tfrequest, metadata=(('seldon', 'tf-grpc'), ('namespace', 'team-xxxx')))

But how to send the above request in seldon-core client and seldon protocol?

@chengcheng-pei chengcheng-pei added the triage Needs to be triaged and prioritised accordingly label Jun 29, 2020
@ukclivecox
Copy link
Contributor

The Seldon protocol needs update to make multi-headed models easier to use. You can send arbitrary tensors if you are willing to split them yourself into individual inputs. You can also use binData and jsonData to send what you want. The current protocol will not work with the Tensorflow proxy.

Your best best at present is to use the Tensorflow protocol for these models. In future we will be introducing a new V2 protocol shared amongst many projects which will also explicitly allow multiple inputs and outputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs to be triaged and prioritised accordingly
Projects
None yet
Development

No branches or pull requests

2 participants