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

yipeiwu_com6年前Python实例


 # 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的最大数量实例就是小编分享给大家的全部内容了,希望能给大家一个参考。

相关文章

浅谈tensorflow中Dataset图片的批量读取及维度的操作详解

三维的读取图片(w, h, c):import tensorflow as tf   import glob import ...

python翻译软件实现代码(使用google api完成)

# -*- coding: utf-8 -*-  import httplib from urllib ...

Python实现FLV视频拼接功能

文章摘要本文简单说明了FLV文件的格式,以此为出发点,使用 Python 实现FLV视频的拼接。一.FLV文件格式关于FLV文件格式的解析网上有诸多文章,在这里就简单介绍一下需要了解的部分...

python动态文本进度条的实例代码

python动态文本进度条的实例代码

如何实现动态单行刷新,答案是——覆盖但是怎么实现覆盖呢关键在于不换行而且能回退到开始位置那么就要用到 \r这个东西就是让光标回退到当前行初始位置记得不能让换行上码#文本进度条.p...

python使用新浪微博api上传图片到微博示例

import urllib.parse,os.path,time,sys from http.client import HTTPSConnection f...