tf.keras.legacy.saving.serialize_keras_object
Stay organized with collections
Save and categorize content based on your preferences.
Serialize a Keras object into a JSON-compatible representation.
tf.keras.legacy.saving.serialize_keras_object(
instance
)
Calls to serialize_keras_object
while underneath the
SharedObjectSavingScope
context manager will cause any objects re-used
across multiple layers to be saved with a special shared object ID. This
allows the network to be re-created properly during deserialization.
Args |
instance
|
The object to serialize.
|
Returns |
A dict-like, JSON-compatible representation of the object's config.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-06-07 UTC.
[null,null,["Last updated 2024-06-07 UTC."],[],[],null,["# tf.keras.legacy.saving.serialize_keras_object\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/keras-team/keras/tree/v3.3.3/keras/src/legacy/saving/serialization.py#L265-L328) |\n\nSerialize a Keras object into a JSON-compatible representation.\n\n#### View aliases\n\n\n**Main aliases**\n\n[`tf.keras.utils.legacy.serialize_keras_object`](https://www.tensorflow.org/api_docs/python/tf/keras/legacy/saving/serialize_keras_object)\n\n\u003cbr /\u003e\n\n tf.keras.legacy.saving.serialize_keras_object(\n instance\n )\n\nCalls to `serialize_keras_object` while underneath the\n`SharedObjectSavingScope` context manager will cause any objects re-used\nacross multiple layers to be saved with a special shared object ID. This\nallows the network to be re-created properly during deserialization.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|------------|--------------------------|\n| `instance` | The object to serialize. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A dict-like, JSON-compatible representation of the object's config. ||\n\n\u003cbr /\u003e"]]