# tf.train.latest_checkpoint

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/train/latest_checkpoint) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/training/checkpoint_management.py#L320-L347) |

Finds the filename of latest saved checkpoint file.

#### View aliases


**Compat aliases for migration**

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

[`tf.compat.v1.train.latest_checkpoint`](https://www.tensorflow.org/api_docs/python/tf/train/latest_checkpoint), \`tf.compat.v2.train.latest_checkpoint\`

<br />

    tf.train.latest_checkpoint(
        checkpoint_dir, latest_filename=None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `checkpoint_dir` | Directory where the variables were saved. |
| `latest_filename` | Optional name for the protocol buffer file that contains the list of most recent checkpoint filenames. See the corresponding argument to [`Saver.save()`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/train/Saver#save). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| The full path to the latest checkpoint or `None` if no checkpoint was found. ||

<br />