代码之家  ›  专栏  ›  技术社区  ›  Him

tensorflow一次运行一批

  •  0
  • Him  · 技术社区  · 8 年前

    我正在通过shuffle\u批量输入管道加载数据。但是,当我去做训练时,我想先训练一下,然后练python一些东西,然后继续训练。然而,我不知道如何从 shuffle_batch 读取器和文件名队列。它只是不停地阅读。。。

    编辑:: 我意识到这是导入数据的“旧方法”。然而,我并没有立即找到用“新方法”来补救这一问题的方法 https://www.tensorflow.org/versions/master/api_docs/python/tf/data/FixedLengthRecordDataset

    如何通过我的培训管道只提供50条cifar记录,然后在我的jupyter笔记本中恢复控制?

    1 回复  |  直到 8 年前
        1
  •  1
  •   de1    8 年前

    基于您使用 https://github.com/tensorflow/models/blob/master/tutorials/image/cifar10/ -实际培训发生在 executing the train_op . 你应该能够把你的逻辑放在那里。例如。:

    while not mon_sess.should_stop():
      mon_sess.run(train_op)
      if mon_sess.run(global_step) % 10 == 0:
        # do something special
    

    否则,它还支持 max_steps 参数,该参数可能与试图限制输入的参数类似。但如果你想继续训练,那就没什么用了。