ZhangGe6 / onnx-modifier

A tool to modify ONNX models in a visualization fashion, based on Netron and Flask.
MIT License
1.29k stars 158 forks source link

Fix the bug when adding node #33

Closed chunchih closed 1 year ago

chunchih commented 1 year ago
  1. the member variable _add_nodeKey in Modifier is missing, so if same op added twice, their names will be overlapped, so update it in constructor
  2. Update remove_isolated_nodes with backtracing from graph_output_names for removing all disconnected nodes.
ZhangGe6 commented 1 year ago

@chunchih Hello, thanks for your contribution!

  1. Missing _add_nodeKey is a bug and can be fixed in the proposed way.

  2. However, it seems that the proposed backtracking schema in remove_isolated_nodes() can not work correctly.

    • Tested in this model. Just open and save it without doing anything, then the model is modified (which is not expected).
    • I have been thinking about the implementation of remove_isolated_nodes() for days. Your proposed way is really inspirational.

Thanks anyway. I am going to merge this PR and elaborate based on it.