keras_to_tensorflow
keras_to_tensorflow copied to clipboard
input node and output node
hi, im coverting hdf5 to pb, so that i can use the model in android. but how do i know the input node name and output node name?
Use -graph_def True to store the text format of the graph.
$ python keras_to_tensorflow.py -graph_def True -input_model_file ...
You will see the input & output layer name (along with many other info.) from the ascii
file generated in the output directory.
@hanako94 Other than what @sumsuddin suggested, you can always explicitly name your layers in keras. I suggest you to name the input and output layers (and any other layer which you might care for).
thanks you so much. i managed to find it by using this method https://developer.arm.com/technologies/machine-learning-on-arm/developer-material/how-to-guides/optimizing-neural-networks-for-mobile-and-embedded-devices-with-tensorflow/determine-the-names-of-input-and-output-nodes
It is possible to use the method to output all names: https://tensorflow.github.io/rust/tensorflow/struct.Graph.html#method.operation_iter
graph.operation_iter().for_each(|x| println!("{}", x.name));
After it, it is easy to detect input and output of the model. Usually dense_1_input and output_node0