Tensorflow出错:Exception in QueueRunner: Enqueue operation was cancelled

深度学习TensorFlow 2677

#没有定义coord
tf.train.start_queue_runners()

替换成

coord = tf.train.Coordinator()
tf.train.start_queue_runners(coord=coord)

也可以写成

# Start the data queue
coord = tf.train.Coordinator()
threads = tf.train.start_queue_runners(sess, coord)
coord = tf.train.Coordinator()
threads = tf.train.start_queue_runners(sess=sess, coord=coord)
<do stuff>
coord.request_stop()
coord.join(threads)

Post Comment