Get outputs from all output nodes

I imported a tensorflow graph with multiple output nodes, but I can only get one output, anyone has ideas where could be wrong?
num_outputs = m.get_num_outputs() -----------> got 1
Thank you very much!

Tensor flow protobuf definition doesn’t list the output nodes.
Hence we considered the last node as graph output default.

from_tensorflow support argument outputs which accepts a list of output node names we are interested in.

Thank you so much, that helps a looooooooooot

1 Like

you mean the from_tensorflow.py from the tutorials, the line of # get outputs
tvm_output = m.get_output(0, tvm.nd.empty(((1, 1008)), ‘float32’)), so if I want to get the second node output, just need to set like this : tvm_output1 = m.get_output(1, tvm.nd.empty((( num1, num2)), ‘float32’)) ?
thank you very much!

No , thats wrong.

What I mean was the output of last node while importing a tensorflow model is taken as output of the model.

If you are interested in getting output of intermediate nodes you make try the debugger @ ./python/tvm/contrib/debugger/

thanks! but if the outputs have two branches like object detection model, one branch of the output is for the classification, and the other branch is for the bounding box. how could I get the two parts of outputs using the tvm after the auto-tunning? thank you very much!

Just specify the output option to tensorflow import. This will generate output as tuple.
Auto tuning is interested about tasks, it doesn’t care about number of outputs. So no problem.

@srkreddy1238 how to set the output option?

from_tensorflow api receives argument outputs .