-
Notifications
You must be signed in to change notification settings - Fork 56
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
Batch Support Error Triton ONNX Backend #111
Comments
Looks similar to #109 For Triton to support dynamic batching the output shape should be Is there a way to make |
@tanmayv25 is the
|
Hello, I tried the polygraphy First, I inspect my model as follow: $ polygraphy inspect model model.onnx
And then, I tried to can the input shape as you said. But I failed. It says no matches found. $ polygraphy surgeon sanitize model.onnx -o output_model.onnx --override-input-shapes input:[-1,3,height,width] What do you suggest me? Thanks |
Hello, I have converted my model input and output tensor shape as follows: And then I tried to inference using onnx-runtime. It works. I share input and output logs of onnx-runtime below: batch array shape: (7, 3, 524, 870) But, when I try to load the model to triton server I got the same error. tensor 'output': for the model to support batching the shape should have at least 1 dimension and the first dimension must be -1; but shape expected by the model is [1,1,-1,-1] I also tried to load model to triton server with "input":[{"name":"input","data_type":"TYPE_FP32","format":"FORMAT_NONE","dims":[-1,3,-1,-1], How can I solve this problem? |
Triton is still reading the output tensor shape as [1, 1, -1, -1] I don't understand these shapes in your comment:
Why is there an extra dimension in the output tensor? And why the batch size
I presume onnx runtime doesn't apply strict output validation as needed by Triton. Something is wrong with the model, the generated tensor |
I dont know why the output tensor shape has extra dimension. My model was trained with PyTorch. I still have .pth file. If you suggest me the way, I can re-convert from .pth to .onnx When I try batch-size=1 inference on Triton, the output tensor shape is (1,524,870) |
Unfortunately, I don't know why it would be happening either. Have you asked it here. We obtain the dimension for the tensor in onnxruntime_backend here. This is giving I am transferring the issue to onnxruntime_backend project. But I think you may be better off working with pytorch and onnx teams to fix your model to generate outputs in expected format. |
Description
Hello,
I have an ONNX model. I am sharing the input and output dimensions of this model below.
I need to deploy this model with Triton Inference Server.
Below is my config file:
name: "segmentation_model"
platform: "onnxruntime_onnx"
max_batch_size: 8
input [
{
name: "input"
data_type: TYPE_FP32
dims: [3, -1, -1 ]
}
]
output [
{
name: "output"
data_type: TYPE_INT64
dims: [ -1,-1,-1]
}
]
When I try to deploy the model with this configfile, I got below error and never solved.
Invalid argument: model 'segmentation_model', tensor 'output': for the model to support batching the shape should have at least 1 dimension and the first dimension must be -1; but shape expected by the model is [1,-1,-1,-1]
I need to batching inference (for example 7 images in one inference), when I try to start tritonserver without config file with this command:
tritonserver --strict-model-config=false --model-repository=triton_model_repository/
I can only inference single image, not batch size>1.
How can I solve this problem?
Thanks
Triton Information
What version of Triton are you using?
tritonserver:21.08-py3
Are you using the Triton container or did you build it yourself?
Docker container
The text was updated successfully, but these errors were encountered: