According to the official Keras documentation, safe_mode is defined as: safe_mode: Boolean, whether to disallow unsafe lambda deserialization. When safe_mode=False, loading an object has the potential ...