I'm trying to build some model using TensorFlow2, so I create a class of my model as follows:
import tensorflow as tf
class Dummy(tf.keras.Model):
def __init__(self, name="dummy"):
super(Dummy, self).__init__()
self._name = name
self.dense1 = tf.keras.layers.Dense(4, activation=tf.nn.relu)
self.dense2 = tf.keras.layers.Dense(5, activation=tf.nn.softmax)
def call(self, inputs, training=False):
x = self.dense1(inputs)
return self.dense2(x)
model = Dummy()
model.build(input_shape=(None,5))
Now I want to plot the model, while using summary()
returns what I expect, plot_model(model, show_shapes=True, expand_nested=True)
return only a block with the model name.
How can I return the graph of my model?