I am trying to plot my model with the tf.keras.utils.model_to_dot()
function but keep getting the following error:
TypeError: object of type 'Cluster' has no len()
Here is the code I use:
import tensorflow
import pydot
model = tf.keras.models.Sequential([
tf.keras.layers.Flatten(input_shape=(28, 28, 1)),
tf.keras.layers.Dense(128,activation='relu'),
tf.keras.layers.Dense(10, activation='softmax')
])
model_graph = tf.keras.utils.model_to_dot(model, expand_nested=True, subgraph=True)
graph = pydot.graph_from_dot_data(model_graph)
graph.write_png('model.png')
What do I do wrong here?