# tf.train.checkpoint_exists

<br />

|---|
| [![](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#L374-L393) |

Checks whether a V1 or V2 checkpoint exists with the specified prefix. (deprecated)

#### View aliases


**Compat aliases for migration**

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

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

<br />

    tf.train.checkpoint_exists(
        checkpoint_prefix
    )

> [!WARNING]
> **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use standard file APIs to check for files with this prefix.

This is the recommended way to check if a checkpoint exists, since it takes
into account the naming difference between V1 and V2 formats.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `checkpoint_prefix` | the prefix of a V1 or V2 checkpoint, with V2 taking priority. Typically the result of [`Saver.save()`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/train/Saver#save) or that of [`tf.train.latest_checkpoint()`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/train/latest_checkpoint), regardless of sharded/non-sharded or V1/V2. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A bool, true if a checkpoint referred to by `checkpoint_prefix` exists. ||

<br />