How to add meaning node names to onnx model exported by torch.onnx.export?

I have a PyTorch model of torch.jit.ScriptModule and have successfully converted it to onnx format. The problem is all the onnx nodes are named with sequential numbers. E.g., in the attached image below, the circled conv’s inputs and outputs are named with numbers (visualized with Netron), which is inconvenient for the following analysis if the network is large. How can I add more meaningful names to these intermediate onnx nodes? Thanks.

2 Likes

Hi @Liming did you end up finding a solution to annotate nodes with more meaningful names? I would be interested in your approach to help with debugging an invalid graph that PyTorch produced