# tf.keras.callbacks.CSVLogger

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L3135-L3224) |

Callback that streams epoch results to a CSV file.

Inherits From: [`Callback`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/keras/callbacks/Callback)

#### View aliases


**Compat aliases for migration**

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

\`tf.compat.v1.keras.callbacks.CSVLogger\`

<br />

    tf.keras.callbacks.CSVLogger(
        filename, separator=',', append=False
    )

Supports all values that can be represented as a string,
including 1D iterables such as `np.ndarray`.

#### Example:

    csv_logger = CSVLogger('training.log')
    model.fit(X_train, Y_train, callbacks=[csv_logger])

<br />

<br />

<br />

| ## Args ||
|---|---|
| `filename` | Filename of the CSV file, e.g. `'run/log.csv'`. |
| `separator` | String used to separate elements in the CSV file. |
| `append` | Boolean. True: append if file exists (useful for continuing training). False: overwrite existing file. |

<br />

## Methods

### `set_model`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L694-L695)

    set_model(
        model
    )

### `set_params`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L691-L692)

    set_params(
        params
    )