Multithreading Tensorflow tf.估计量.带QueueRunner的估计量
我正在重写我的to代码,以使用tf.estimator.estimator作为模型的封装对象。 问题是: 我看不出典型的输入管道有多适合这幅图 我的输入管道使用由tf.train.Coordinator协调的队列 为了满足tf.estimator.estimator的要求,我在init_fn函数中创建了所有输入图,调用时传递给estimator:Multithreading Tensorflow tf.估计量.带QueueRunner的估计量,multithreading,tensorflow,tensorflow-estimator,Multithreading,Tensorflow,Tensorflow Estimator,我正在重写我的to代码,以使用tf.estimator.estimator作为模型的封装对象。 问题是: 我看不出典型的输入管道有多适合这幅图 我的输入管道使用由tf.train.Coordinator协调的队列 为了满足tf.estimator.estimator的要求,我在init_fn函数中创建了所有输入图,调用时传递给estimator: Estimator.train(...) 看起来像这样 输入fnf: 问题是:在这种情况下,我如何分别在估计器的开始和开始处启动和停止队列运行程序
Estimator.train(...)
看起来像这样
输入fnf:
问题是:在这种情况下,我如何分别在估计器的开始和开始处启动和停止队列运行程序。训练
开始
我找到了启动我可以传递的队列的方法,并使用init_fn对传递给估计器的scaffold对象执行此操作
然而,如何连接线程并优雅地关闭它们-这我不知道
使用tf.estimator时,是否有合适的线程输入管道的参考体系结构
Estimator类准备好处理队列了吗?Estimator使用tf.train.MonitoredTrainingSession处理启动和加入线程。您可以检查几个示例输入FN,例如
tf.estimator.input.*,tf.contrib.learn.io.read*
...create input graph...
qr = tf.train.QueueRunner(queue, [operations...])
tf.train.add_queue_runner(qr)