How to save training model at each training step instead of periodic save based on time interval.? - in TensorFlow-Slim

限于喜欢 提交于 2020-01-15 05:30:29

问题


slim.learning.train(...) accepts two arguments pertaining to saving the model(save_interval_secs) or saving the summaries(save_summaries_secs). The problem with this API is, it only allows to save the model/summary based on some "time interval" but I need to do this based on "each step" of the training.

how to achieve this using TF-slim api.?

Here is the slim.learning train api -

def train(train_op,
          logdir,
          train_step_fn=train_step,
          train_step_kwargs=_USE_DEFAULT,
          log_every_n_steps=1,
          graph=None,
          master='',
          is_chief=True,
          global_step=None,
          number_of_steps=None,
          init_op=_USE_DEFAULT,
          init_feed_dict=None,
          local_init_op=_USE_DEFAULT,
          init_fn=None,
          ready_op=_USE_DEFAULT,
          summary_op=_USE_DEFAULT,
          **save_summaries_secs=600,**
          summary_writer=_USE_DEFAULT,
          startup_delay_steps=0,
          saver=None,
          **save_interval_secs=600,**
          sync_optimizer=None,
          session_config=None,
          session_wrapper=None,
          trace_every_n_steps=None,
          ignore_live_threads=False):

回答1:


Slim is deprecated, and using Estimator you get full control over saving / summary frequency.

You can also set the seconds to a very small number so it always saves.



来源:https://stackoverflow.com/questions/48465648/how-to-save-training-model-at-each-training-step-instead-of-periodic-save-based

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!