CODAIT / graph_def_editor

GraphDef Editor: A port of the TensorFlow contrib.graph_editor package that operates over serialized graphs
Apache License 2.0
31 stars 16 forks source link

How to change operation name in the graph? #48

Open zdaiot opened 2 years ago

zdaiot commented 2 years ago

Hello,Do you knwo how to change operation name in the graph?Which api should I use?

vlasenkoalexey commented 2 years ago

To change operation name use graph.rename_node, to change operation type use node.change_op_type.

zdaiot commented 2 years ago

@vlasenkoalexey Hello,I use TF1.15. And I get AttributeError: 'Graph' object has no attribute 'rename_node'

vlasenkoalexey commented 2 years ago

See how to use it in examples: https://github.com/CODAIT/graph_def_editor/blob/76e994726630773b8e889c26c49d552b24c71813/examples/coco_example.py#L263

zdaiot commented 2 years ago

@vlasenkoalexey Thanks your reply. But I found that this example operates on frozen graph. Do you know how to change the node name in checkpoint or savedmodel?