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

TSR model export onnx, but does not support dynamic batch #179

Open
qrsssh opened this issue May 6, 2024 · 1 comment
Open

TSR model export onnx, but does not support dynamic batch #179

qrsssh opened this issue May 6, 2024 · 1 comment

Comments

@qrsssh
Copy link

qrsssh commented May 6, 2024

 input_names = ["input_ids"]
 output_names =  ['pred_logits', 'pred_boxes']
 a=torch.randn(20,3, 1000, 727)

 dynamic_axes={
                    "input_ids": {0: 'batch', 2: 'input_height', 3: 'input_width'},
                    "pred_logits": {0: 'batch'},
                    "pred_boxes": {0: 'batch'},
                    }

    torch.onnx.export(self.str_model, a, "./a.onnx", verbose=False, do_constant_folding=True, 
                                input_names=input_names, output_names=output_names, 
                                opset_version=12, dynamic_axes=dynamic_axes) 

No errors were reported and the onnx model was exported
However, only the same batch size as input is supported during inference.

@qrsssh
Copy link
Author

qrsssh commented May 6, 2024

@bsmock @rohithpv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant