列出檢查點中變量的檢查點鍵和形狀。
用法
tf.train.list_variables(
ckpt_dir_or_file
)
參數
-
ckpt_dir_or_file
帶有檢查點文件或檢查點路徑的目錄。
返回
-
元組列表
(key, shape)
。
檢查點鍵是檢查點圖中的路徑。
示例用法:
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)
相關用法
- Python tf.train.Coordinator.stop_on_exception用法及代碼示例
- Python tf.train.ExponentialMovingAverage用法及代碼示例
- Python tf.train.Checkpoint.restore用法及代碼示例
- Python tf.train.Checkpoint.read用法及代碼示例
- Python tf.train.CheckpointOptions用法及代碼示例
- Python tf.train.ClusterSpec用法及代碼示例
- Python tf.train.Checkpoint.save用法及代碼示例
- Python tf.train.Checkpoint.write用法及代碼示例
- Python tf.train.Coordinator用法及代碼示例
- Python tf.train.CheckpointManager用法及代碼示例
- Python tf.train.Checkpoint用法及代碼示例
- Python tf.transpose用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.train.list_variables。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。