# tf.keras.losses.deserialize

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v2.14.0/keras/losses.py#L2896-L2923) |

Deserializes a serialized loss class/function instance.

#### View aliases


**Main aliases**

[`tf.losses.deserialize`](https://www.tensorflow.org/api_docs/python/tf/keras/losses/deserialize)

<br />

    tf.keras.losses.deserialize(
        name, custom_objects=None, use_legacy_format=False
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `name` | Loss configuration. |
| `custom_objects` | Optional dictionary mapping names (strings) to custom objects (classes and functions) to be considered during deserialization. |
| `use_legacy_format` | Boolean, whether to use the legacy serialization format. Defaults to `False`. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A Keras `Loss` instance or a loss function. ||

<br />