0
我有以下代碼:隊列爲空
import tensorflow as tf
xs = tf.random_normal([5, 2])
ys = xs[:, 0] + xs[:, 1] + tf.random_normal([5], stddev=0.01)
xs_inp, ys_inp = tf.train.slice_input_producer([xs, ys], num_epochs=20)
coord = tf.train.Coordinator()
with tf.Session() as sess:
threads = tf.train.start_queue_runners(coord=coord)
for i in range(100):
print(sess.run([xs_inp, ys_inp]))
coord.request_stop()
coord.join(threads)
在我看來,我應該服用100對及打印出來,但程序不顯示任何信息,並拋出異常。
tensorflow.python.framework.errors_impl.OutOfRangeError: FIFOQueue '_0_input_producer/input_producer' is closed and has insufficient elements (requested 1, current size 0)
非常感謝,你是如此的有幫助。如果沒有你,我需要幾天時間才能找出問題所在。 –