def get_serialized(obj): with generic_utils.skip_failed_serialization(): # Store the config dictionary, which may be used when reviving the # object. When loading, the program will attempt to revive the object # from config, and if that fails, the object will be revived from the # SavedModel. return generic_utils.serialize_keras_object(obj)
def get_config(obj): with generic_utils.skip_failed_serialization(): # Store the config dictionary, which may be used when reviving the object. # When loading, the program will attempt to revive the object from config, # and if that fails, the object will be revived from the SavedModel. config = generic_utils.serialize_keras_object(obj)['config'] if config is not None: return {'config': config} return {}