# tf.keras.models.model_from_yaml

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 1 version](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/models/model_from_yaml) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.1.0/tensorflow/python/keras/saving/model_config.py#L58-L78) |

Parses a yaml model configuration file and returns a model instance.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.keras.models.model_from_yaml`](https://www.tensorflow.org/api_docs/python/tf/keras/models/model_from_yaml)

<br />

    tf.keras.models.model_from_yaml(
        yaml_string, custom_objects=None
    )

<br />

<br />

<br />

| ## Arguments ||
|---|---|
| `yaml_string` | YAML string encoding a model configuration. |
| `custom_objects` | Optional dictionary mapping names (strings) to custom classes or functions to be considered during deserialization. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A Keras model instance (uncompiled). ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ImportError` | if yaml module is not found. |

<br />