diff --git a/Samples/CustomOperatorCPU/customize_model/example_models/squeezenet_debug_all_outputs.onnx b/Samples/CustomOperatorCPU/customize_model/example_models/squeezenet_debug_all_outputs.onnx index d54226fc..a1ef1035 100644 Binary files a/Samples/CustomOperatorCPU/customize_model/example_models/squeezenet_debug_all_outputs.onnx and b/Samples/CustomOperatorCPU/customize_model/example_models/squeezenet_debug_all_outputs.onnx differ diff --git a/Samples/CustomOperatorCPU/customize_model/scripts/debug_all_outputs.py b/Samples/CustomOperatorCPU/customize_model/scripts/debug_all_outputs.py index ac2aec18..2156764c 100644 --- a/Samples/CustomOperatorCPU/customize_model/scripts/debug_all_outputs.py +++ b/Samples/CustomOperatorCPU/customize_model/scripts/debug_all_outputs.py @@ -18,6 +18,11 @@ def create_modified_model(args): for output in node.output: intermediate_outputs.add(output) + # remove final graph outputs (see the definition of graph outputs in the onnx standard: https://github.com/onnx/onnx/blob/master/docs/IR.md#user-content-graphs) + # it would be invalid to add debug operators after the final graph outputs since execution must be finished once all outputs are written to + for output in model.graph.output: + intermediate_outputs.remove(output.name) + # create a debug operator that consumes each intermediate output # debug operator file path attribute is constructed by the name of the intermediate output for output in intermediate_outputs: