Trouble sending image data to Triton Server
See original GitHub issueDescription I am trying to send an image to my model that is hosted on Triton Server. I have tried doing this in two ways. One, sending the image like this:
{
"id": "1",
"inputs": [
{
"name": "input_tensor",
"datatype": "UINT8",
"shape": [
1,
1,
1,
3
],
"data": [--image data as bytes (type is unsigned int8)--]
}
]
}
With this, I get this error: {"error":"attempt to access JSON non-unsigned-integer as unsigned-integer"}
.
The other way I try to send is using the Binary Tensor Data Extension
but I’ve gotten a few errors, one being: http_server.cc:2327 Infer failed: must specifiy valid 'Infer-Header-Content-Length' in request header and 'binary_data_size' when passing inputs in binary data format
.
For the Binary Tensor Data Extension
I am confused on how to set the call up properly because it says we need to send the request a an octet-stream but also include a JSON body. How are we to accomplish both of this in one call?
Triton Information What version of Triton are you using? 20.13
Are you using the Triton container or did you build it yourself? Built using Docker
To Reproduce
Using Tensorflow 2 Object Detection API model which returns num_detections
, detection_boxes
, detection_scores
, detection_classes
, and image_tensor
.
Expected behavior I am trying to successfully send image data to Triton server from my client project and get a response back.
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (5 by maintainers)
Top GitHub Comments
Hi, @gioipv , sorry for misleading you. The purpose of adding image size in
hex
intostuff_mug
step, is just want to show you how the “binary_data_size” is got in postdata.json.So,
0x0f5992
is image binary data size. And then, “binary_data_size”=image_data_size(0x0f5992 or 1005970) + length of data_size( 4), then that is 1005974.As for why need to add
hex data_size
beforebinary data
when append image data topost json data
, may related to how binary data is processed inside HTTP server. I didn’t pay much attention to this part.@zet809 thankyou for sharing. i read the binary data extension . But i dont understand that, in you comment,
1005970
is the image size in bytes ?. why do you add the image size inhex
formated is(0x0f5992)
instuff_mug
. ? and how to get image size in bytes ?, Could you tell me about that, Thank you