I'm using a lambda function to create a custom activation function but when I try to upload a checkpoint I get the error:
ValueError: Unknown activation function:<lambda>
The function is:
lrelu = lambda x: tf.keras.activations.relu(x, alpha=0.2)
and used like this:
Conv2D(filters=96, kernel_size=(3,3),strides=(2,2),activation=lrelu)
I tried to add the custom_objects with no luck:
model = load_model(filepath, custom_objects = {"lrelu": lrelu})
I know I can replace my function with an extra layer and avoid this problem, but I was wondering if there is a way to make this work.
Thanks.