if __name__ == '__main__':
g = Graph(); print("Training Graph loaded")
# with g.graph.as_default():
sv = tf.train.Supervisor(logdir=hp.logdir, save_summaries_secs=60, save_model_secs=0)
with sv.managed_session() as sess:
while 1:
for _ in tqdm(range(g.num_batch), total=g.num_batch, ncols=70, leave=False, unit='b'):
_, gs = sess.run([g.train_op, g.global_step])
# Write checkpoint files
if gs % 1000 == 0:
sv.saver.save(sess, hp.logdir + '/model_gs_{}k'.format(gs//1000))
# plot the first alignment for logging
al = sess.run(g.alignments)
plot_alignment(al[0], gs)
print("Done")
数据加载程序无法停止
答案 0 :(得分:0)
你有一个while 1
循环...这将永远运行。你需要一个在某个地方内部导致break
的条件。
答案 1 :(得分:0)
您的while
语句缺少break
规则,要么删除第一个,要么在plot_alignment
停止循环后添加第二个