Your model contains Lambda layer. The documentation 2 says that this layer is meant for quick experimentation and is likely to cause serialization problems. Try to subclass tf.keras.layers.Layer and implement the same logic there instead of Lambda.