gpt4 book ai didi

tensorflow - 如何控制 tensorflow 估计器保留的检查点数量?

转载 作者:行者123 更新时间:2023-12-04 17:20:59 24 4
gpt4 key购买 nike

我注意到新的 Estimator API 会在训练期间自动保存检查点,并在训练中断时自动从最后一个检查点重新开始。不幸的是,它似乎只保留了最后 5 个检查点。

您知道如何控制训练期间保留的检查点数量吗?

最佳答案

Tensorflow tf.estimator.Estimator需要 config作为可选参数,可以是 tf.estimator.RunConfig对象来配置运行时设置。您可以按如下方式实现:

# Change maximum number checkpoints to 25
run_config = tf.estimator.RunConfig()
run_config = run_config.replace(keep_checkpoint_max=25)

# Build your estimator
estimator = tf.estimator.Estimator(model_fn,
model_dir=job_dir,
config=run_config,
params=None)
config参数可用于扩展 DNNClassifier 的所有类( DNNLinearCombinedClassifierLinearClassifierestimator.Estimator 等) .

关于tensorflow - 如何控制 tensorflow 估计器保留的检查点数量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48028262/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com