MonitoredTrainingSession指定is_chief之后,一直报:tensorflow:Waiting for model to be ready. Ready_for_local_

Posted lixiaolun

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MonitoredTrainingSession指定is_chief之后,一直报:tensorflow:Waiting for model to be ready. Ready_for_local_相关的知识,希望对你有一定的参考价值。

 
MonitoredTrainingSession指定is_chief之后,报错:tensorflow:Waiting for model to be ready. Ready_for_local_init_op: Variables not initialized

原因:还是因为MonitoredTrainingSession中没有指定:master=server.target,添加之后就可以正常运行了。

with tf.train.MonitoredTrainingSession(
  master=server.target,
  is_chief=is_chief,
  checkpoint_dir=checkpoint_dir,
  save_checkpoint_secs=FLAGS.save_interval_secs,
  save_summaries_steps=100,
  save_summaries_secs=None,
  config=sess_config,
  hooks=hooks) as sess:

 

但是还会报一次tensorflow:Waiting for model to be ready. Ready_for_local_init_op: Variables not initialized

此时,可以让非worker 0 sleep 5秒

time.sleep(5)

参考: https://stackoverflow.com/questions/42397370/distributed-tensorflow-save-fails-no-device

 

以上是关于MonitoredTrainingSession指定is_chief之后,一直报:tensorflow:Waiting for model to be ready. Ready_for_local_的主要内容,如果未能解决你的问题,请参考以下文章

tf.train.MonitoredTrainingSession 和 tf.train.Supervisor 有啥区别

tf.train.MonitoredTrainingSession()的使用案例

MonitoredTrainingSession指定is_chief之后,一直报:tensorflow:Waiting for model to be ready. Ready_for_local_

tf.train.MonitoredTrainingSession 中的 tf.train.CheckpointSaverHook 是不是会在检查点或异步完成时阻止训练?

tensorflow-MonitoredTrainingSession解读

六指按键,单指双控开镜开火吃鸡神器