# tf.train.get_checkpoint_state

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 1 version](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/train/get_checkpoint_state) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.1.0/tensorflow/python/training/checkpoint_management.py#L244-L298) |

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 />