Merge pull request #20957 from cheerss:master
PiperOrigin-RevId: 205338870
This commit is contained in:
commit
6155633318
@ -467,13 +467,13 @@ JSON and YAML serialization formats:
|
|||||||
json_string = model.to_json()
|
json_string = model.to_json()
|
||||||
|
|
||||||
# Recreate the model (freshly initialized)
|
# Recreate the model (freshly initialized)
|
||||||
fresh_model = keras.models.from_json(json_string)
|
fresh_model = keras.models.model_from_json(json_string)
|
||||||
|
|
||||||
# Serializes a model to YAML format
|
# Serializes a model to YAML format
|
||||||
yaml_string = model.to_yaml()
|
yaml_string = model.to_yaml()
|
||||||
|
|
||||||
# Recreate the model
|
# Recreate the model
|
||||||
fresh_model = keras.models.from_yaml(yaml_string)
|
fresh_model = keras.models.model_from_yaml(yaml_string)
|
||||||
```
|
```
|
||||||
|
|
||||||
Caution: Subclassed models are not serializable because their architecture is
|
Caution: Subclassed models are not serializable because their architecture is
|
||||||
|
Loading…
Reference in New Issue
Block a user