TensorRT
                                
                                 TensorRT copied to clipboard
                                
                                    TensorRT copied to clipboard
                            
                            
                            
                        Fix duplicated input node issue in TensorRT 8.6 ONNX export
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 cleanupmethod in the ONNX export process to includeremove_unused_graph_inputs=Trueto 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 [email protected]