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

Fix duplicated input node issue in TensorRT 8.6 ONNX export #4137

Open
wants to merge 1 commit into
base: release/8.6
Choose a base branch
from

Conversation

Phoenix8215
Copy link

Description

Fix duplicated input node issue in TensorRT 8.6 ONNX export.

This PR addresses a problem where exporting ONNX models using TensorRT 8.6 results in two input nodes being generated. The root cause of the issue is that unused graph inputs are not being removed during the export process. By adding the parameter remove_unused_graph_inputs=True in the graph.cleanup() method, this PR ensures that only the necessary input nodes are preserved in the final ONNX model.

Changes

  • Modified the cleanup method in the ONNX export process to include remove_unused_graph_inputs=True to remove unnecessary input nodes.
  • This change affects the ONNX export functionality, ensuring that models are exported correctly with the expected input nodes.

Testing

This fix was tested in the TensorRT 8.6 environment. After applying the changes, ONNX models that previously exhibited the issue of duplicated input nodes were tested and now produce the correct number of input nodes.

  • Verified the fix on multiple ONNX models that encountered this issue.
  • Ensured no regressions in related functionalities.

Documentation

No changes to documentation are needed as this is a bug fix to the existing ONNX export functionality.

Signed-off-by: Phoenix fengzhe8215@foxmail.com

图片
图片

Signed-off-by: Phoenix <fengzhe8215@foxmail.com>
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

Successfully merging this pull request may close these issues.

1 participant