tf.train.list_variables
Перечисляет ключи контрольных точек и формы переменных в контрольной точке.
tf.train.list_variables(
ckpt_dir_or_file
)
Используется в ноутбуках
| Используется в руководстве | Используется в учебных пособиях |
|---|---|
Ключи контрольных точек — пути в графике контрольной точки.
Пример использования:
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 | Каталог с файлами контрольных точек или путь к контрольной точке. |
| Возвращает | |
|---|---|
Список кортежей (key, shape). |
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/train/list_variables