<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.21.0/tensorflow/python/checkpoint/checkpoint_management.py#L250-L306) |

Returns CheckpointState proto from the "checkpoint" file.

#### View aliases


**Compat aliases for migration**

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

[`tf.compat.v1.train.get_checkpoint_state`](https://www.tensorflow.org/api_docs/python/tf/train/get_checkpoint_state)

<br />

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

If the "checkpoint" file contains a valid CheckpointState
proto, returns it.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `checkpoint_dir` | The directory of checkpoints. |
| `latest_filename` | Optional name of the checkpoint file. Default to 'checkpoint'. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A CheckpointState if the state was available, None otherwise. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | if the checkpoint read doesn't have model_checkpoint_path set. |

<br />