I'm aware of Tensorboard and how awesome it is, but I think that simple console output with current graph summary is better (and faster) for prototyping purpose. And also know that I can generate tensorboard graph after simply running session with last network node as shown here.
What I'm looking for is something similar to model.summary()
from Keras.
In another words: how to iterate over tensorflow graph and print out only custom high end layer with their shapes and dtypes in the same order how all these layer where generated?
It's certainly possible. If you are using tf.keras
wrapper to build you can easily visualize the graph, even before model.compile()
method executes.
It's keras
built-in functionality called plot_model()
.
*This method have dependency on graphviz
and pydot
libraries.
for pydot installation : pip install pydot
but for graphviz
installation you have follow step in this page. And also probably you have to restart the machine because of there it create system environment variables.
for tutorial on how to use this method follow this link
To plot your model with shapes and dtypes before training you could use:
tf.keras.utils.plot_model(model, show_shapes=True, expand_nested=True, show_dtype=True)
where "model" is your built model. The output of a model could looks like this:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With