Spec-Zone.ru › TensorFlow 2.9

tf.train.list_variables

Просмотреть исходный код на GitHub

Перечисляет ключи контрольных точек и формы переменных в контрольной точке.

Просмотр псевдонимов

Псевдонимы для миграции

См. Руководство по миграции для получения дополнительных сведений.

tf.compat.v1.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/versions/r2.9/api_docs/python/tf/train/list_variables

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API