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

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

相关文章

Python版的文曲星猜数字游戏代码

# -*- coding: utf-8 -*- import random #数字类 class NumberItem...

python实现代理服务功能实例

python实现代理服务功能实例

    代理服务原理很简单,就拿浏览器与web服务器来说。无非是A浏览器发request给B代理,B代理再把request把送给C web服务,然后C的reponse-&...

django 文件上传功能的相关实例代码(简单易懂)

django 文件上传功能的相关实例代码(简单易懂)

一、新建项目,在主配置文件中,修改以下内容:ALLOWED_HOSTS = ['127.0.0.1','localhost'] MED...

python发送邮件的实例代码(支持html、图片、附件)

第一段代码:#!/usr/bin/python # -*- coding: utf-8 -*- import email imp...

Python实现FLV视频拼接功能

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