tensorflow-tf.train

200 阅读1分钟

模型加载和处理

tf.train.latest_checkpoint

1. 方法作用

会自动的在指定的文件下查找最新的checkpoint.checkpoint:保存当前变量,包括神经网络的权重等.

1.方法定义

latest_checkpoint(
    checkpoint_dir,
    latest_filename=None
)

2. 参数说明

  • checkpoint_dir: .ckpt文件保存的目录,.ckpt文件记载已经由训练得到的参数
  • return
      if find:
          return full_path_to_latest_checkpoint
      else:
          return None