当前位置: 移动技术网 > IT编程>脚本编程>Python > 在tensorflow中设置保存checkpoint的最大数量实例

在tensorflow中设置保存checkpoint的最大数量实例

2020年03月09日  | 移动技术网IT编程  | 我要评论

bookman,封面设计素材,fs48c

1、我就废话不多说了,直接上代码吧!

 # set up a runconfig to only save checkpoints once per training cycle.
 run_config = tf.estimator.runconfig(save_checkpoints_secs=1e9,keep_checkpoint_max = 10)
 model = tf.estimator.estimator(
   model_fn=deeplab_model_focal_class_imbalance_loss_adaptive.deeplabv3_plus_model_fn,
   model_dir=flags.model_dir,
   config=run_config,
   params={
     'output_stride': flags.output_stride,
     'batch_size': flags.batch_size,
     'base_architecture': flags.base_architecture,
     'pre_trained_model': flags.pre_trained_model,
     'batch_norm_decay': _batch_norm_decay,
     'num_classes': _num_classes,
     'tensorboard_images_max_outputs': flags.tensorboard_images_max_outputs,
     'weight_decay': flags.weight_decay,
     'learning_rate_policy': flags.learning_rate_policy,
     'num_train': _num_images['train'],
     'initial_learning_rate': flags.initial_learning_rate,
     'max_iter': flags.max_iter,
     'end_learning_rate': flags.end_learning_rate,
     'power': _power,
     'momentum': _momentum,
     'freeze_batch_norm': flags.freeze_batch_norm,
     'initial_global_step': flags.initial_global_step
   })

以上这篇在tensorflow中设置保存checkpoint的最大数量实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持移动技术网。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网