W3cubDocs

/TensorFlow Python

tf.train.checkpoint_exists

tf.train.checkpoint_exists(checkpoint_prefix)

Defined in tensorflow/python/training/saver.py.

Checks whether a V1 or V2 checkpoint exists with the specified 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.

Args:

  • checkpoint_prefix: the prefix of a V1 or V2 checkpoint, with V2 taking priority. Typically the result of Saver.save() or that of tf.train.latest_checkpoint(), regardless of sharded/non-sharded or V1/V2.

Returns:

A bool, true iff a checkpoint referred to by checkpoint_prefix exists.

© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/train/checkpoint_exists