onnx-tensorflow
onnx-tensorflow copied to clipboard
Exported tensorflow model outputs don't use onnx model output names
The exported TF model doesn't use the output names specified while exporting the onnx models.
The onnx output model names are:
onnx_output_names =[node.name for node in model.graph.output]
onnx output names: ['output', 'hidden_state', 'cell_state']
But tensorflow->
model.signatures["serving_default"].outputs
[Identity:0, Identity_1:0, Identity_2:0]
Is there a way to change this?
You should be able to find the structured outputs using m.signatures['serving_default'].structured_outputs
Using structured_outputs, I get ['Output0', 'Output1', 'Output2 '].
Hi, I am using onnx-tf==1.9.0
and I am getting "serving_default_input:0"
as input name and "PartitionedCall:0"
as output name although they were all named something else in the onnx model.
Are you looking at the pb file from a viewer like Netron? Unfortunately the generated pb is part of a TF saved model, not a pure computational graph. In order to see the model input and output names, you need to run code using tf.saved_model API.