# How can I read input node and output node from .h5 file in keras model?

I trained my own dataset using MaskRCNN. My trained file is in .h5 file format. Now I want to know/read input node names and output node names.

How can I read?

## 1 Answer

I assume that you have the Keras .h5 file ready. Now, we need to load the model from that file using,

model = keras.models.load_model( 'model.h5' )


model represents the Keras model. Now, model.input will correspond to the input tensor.

input = model.input
output = model.output


Also, you get the output in a similar way. The input and output tensors will have their names. This can be observed by printing the tensor using Python's print.

• Thanks for your comment. Your answer is ok for my question, but. I saved only weight not model. However, now I understood my problem. – Learning Jul 15 '19 at 7:26