Skip to content

Add onnx option for trt_export API #6258

@binliunls

Description

@binliunls

Is your feature request related to a problem? Please describe.
Currently in the MONAI bundle, the trt_export API only supports exporting models through TorchScript directly. Although this is a better way to convert, a few models couldn't be converted this way. Fortunately, there is a workaround for this conversion, which is convert the torch model to an onnx model, convert the onnx model to a TensorRT engine and wrap the engine back to TorchScript. It's a little bit tedious but works for now.

Describe the solution you'd like
Add a use_onnx parameter to trt_export.
Update the convert_to_trt function to leverage the onnx.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions