Provides a scope in which Clustered layers and models can be deserialized.
tfmot.clustering.keras.cluster_scope()
Used in the notebooks
If a keras model or layer has been clustered, it needs to be within this scope
to be successfully deserialized.
Returns |
Object of type CustomObjectScope with clustering objects included.
|
Example:
clustered_model = cluster_weights(model, **self.params)
tf.keras.models.save_model(clustered_model, keras_file)
with cluster_scope():
loaded_model = tf.keras.models.load_model(keras_file)