tf.train.list_variables

Lists the checkpoint keys and shapes of variables in a checkpoint.

Compat aliases for migration

See Migration guide for more details.

tf.compat.v1.train.list_variables

Checkpoint keys are paths in a checkpoint graph.

</td>
</tr>

</table>


import tensorflow as tf
import os
ckpt_directory = "/tmp/training_checkpoints/ckpt"
ckpt = tf.train.Checkpoint(optimizer=optimizer, model=model)
manager = tf.train.CheckpointManager(ckpt, ckpt_directory, max_to_keep=3)
train_and_checkpoint(model, manager)
tf.train.list_variables(manager.latest_checkpoint)

ckpt_dir_or_file Directory with checkpoints file or path to checkpoint.

List of tuples (key, shape).