tensorflow / tfjs

A WebGL accelerated JavaScript library for training and deploying ML models.
https://js.tensorflow.org
Apache License 2.0
18.39k stars 1.92k forks source link

How to find a frozen model 's --output_node_names for tensorflowjf converter #2735

Closed navan0 closed 4 years ago

navan0 commented 4 years ago

How to find a frozen model 's --output_node_names for tensorflowjf converter ?

tensorflowjs_converter \ --input_format=tf_frozen_model \ --output_node_names='MobilenetV1/Predictions/Reshape_1' \ /mobilenet/frozen_model.pb \ /mobilenet/web_model

returns an error like KeyError: "The name 'MobilenetV1/Predictions/Reshape_1' refers to an Operation not in the graph." how to find the correct output_node_names ?

rthadur commented 4 years ago

As mentioned here frozen models are not supported in v1.x , please follow these instructions if you want to convert a frozen model.

pyu10055 commented 4 years ago

@Navan0 @rthadur We did recently add the frozen graph model support back to v 1.x, since there is still quite some demands for that. Back to the original question, how to find the output node name for frozen model, this are no direct answers, you would have to know the topology of model. This is also the main reason we recommend people to use saved model, which contains signatures that identify the input/output nodes. It would be better to ask the creator of the frozen model, they should know about the output nodes, since that is one of the parameters you need to provide, in order to freeze the graph.

rthadur commented 4 years ago

@pyu10055 thank you for the clarification.

navan0 commented 4 years ago

thanks @pyu10055 for the clarification, i'm closing the issue