Pio*_*pla 3 tensorflow tensorflow-estimator
我注意到新的Estimator API会在训练期间自动保存检查点,并在训练中断时自动从上一个检查点重新启动.不幸的是,它似乎只保留了最后5个检查点.
您知道如何控制培训期间保留的检查点数量吗?
Tensorflow tf.estimator.Estimator需要config
作为可选参数,其可以是tf.estimator.RunConfig对象配置运行时settings.You可以实现这样的,如下所示:
# 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)
Run Code Online (Sandbox Code Playgroud)
config
参数是在所有类(得DNNClassifier
,DNNLinearCombinedClassifier
,LinearClassifier
延伸等)estimator.Estimator
.
归档时间: |
|
查看次数: |
964 次 |
最近记录: |