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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support dynamic batch inference with onnx/onnxruntime #45

Closed
zhiqwang opened this issue Feb 1, 2021 · 3 comments 路 Fixed by #193
Closed

Support dynamic batch inference with onnx/onnxruntime #45

zhiqwang opened this issue Feb 1, 2021 · 3 comments 路 Fixed by #193
Labels
deployment Inference acceleration for production enhancement New feature or request help wanted Extra attention is needed

Comments

@zhiqwang
Copy link
Owner

zhiqwang commented Feb 1, 2021

馃殌 Feature

Support dynamic batch inference with onnx/onnxruntime.

Motivation

As @makaveli10 pointed out in #39 (comment), the current implementation of onnx/onnxruntime mechanism only supports dynamic shapes inference, not dynamic batch size.

I didn't know how to implement the dynamic batch inference, any help is welcome here.

@zhiqwang zhiqwang added enhancement New feature or request help wanted Extra attention is needed labels Feb 1, 2021
@makaveli10
Copy link

Thanks. I'll run some experiments and see how it goes.

@timmh
Copy link

timmh commented Aug 3, 2022

I followed the ONNX deployment walkthrough and run export_onnx(..., skip_preprocess=True). However, during the inference using PredictorORT(weights).predict(inputs) I get the following error when trying to use a batch size different from 1:

onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Non-zero status code returned while running Split node. Name:'Split_48' Status Message: Cannot split using values in 'split' attribute. Axis=0 Input shape={10,3,450,600} NumOutputs=1 Num entries in 'split' (must equal number of outputs) was 1 Sum of sizes in 'split' (must equal size of selected axis) was 1

This error occcurs independently of the batch_size parameter used in tracing. The model I export is just a vanilla YOLOv5 model.

@zhiqwang
Copy link
Owner Author

zhiqwang commented Aug 3, 2022

Hi @timmh , The default example only supports ONNX models with preprocessing, could you please open a new ticket about inferencing without preprocessing for easier to track this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment Inference acceleration for production enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants