From 3d4f554b97c2570f43d928eecad674e76677267b Mon Sep 17 00:00:00 2001 From: Phoenix Date: Sat, 21 Sep 2024 16:25:41 +0800 Subject: [PATCH] Fix duplicated input node issue in TensorRT 8.6 ONNX export Signed-off-by: Phoenix --- tools/onnx-graphsurgeon/examples/04_modifying_a_model/modify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/onnx-graphsurgeon/examples/04_modifying_a_model/modify.py b/tools/onnx-graphsurgeon/examples/04_modifying_a_model/modify.py index 55d42234..e2f479fd 100644 --- a/tools/onnx-graphsurgeon/examples/04_modifying_a_model/modify.py +++ b/tools/onnx-graphsurgeon/examples/04_modifying_a_model/modify.py @@ -43,6 +43,6 @@ # Therefore, you should only need to sort the graph when you have added new nodes out-of-order. # In this case, the identity node is already in the correct spot (it is the last node, # and was appended to the end of the list), but to be on the safer side, we can sort anyway. -graph.cleanup().toposort() +graph.cleanup(remove_unused_graph_inputs=True).toposort() onnx.save(gs.export_onnx(graph), "modified.onnx")