philipperemy/keras-tcn

ValueError: Cannot serialize LeakyReLU since it doesn't implement `get_config()`, and also doesn have `__name__`

943fansi opened this issue · 2 comments

Describe the bug
when use plot_model, raise ValueError

model define:

inputs = tf.keras.layers.Input(shape=input_shape, name='input')
tcn_out = TCN(nb_filters=64, kernel_size=3, nb_stacks=1, activation="LeakyReLU")(inputs)
outputs = Dense(forecast_horizon * num_features, activation='linear')(tcn_out)
outputs = tf.reshape(outputs, shape=(-1, forecast_horizon, num_features), name='ouput')
model = tf.keras.Model(inputs=inputs, `outputs=outputs)`
tf.keras.utils.plot_model(
    model,
    to_file="TCN_model.png",
    show_shapes=True,
    show_dtype=True,
    show_layer_names=True,
    rankdir="TB",
    expand_nested=False,
    dpi=96,
    layer_range=None,
    show_layer_activations=True,
)

tf.__version__: 2.8.0

want to get model's png like
#112

Fixed in 05cfa3d

Keras TCN 3.4.4 pushed. Please update.