tensorflow.python.framework.errors_impl.OutOfRangeError: FIFOQueue

Traceback (most recent call last):
File "/home/human-machine/Speech/deep-voice-conversion-master/train1.py", line 90, in 
train(logdir='./logdir/default/train1', queue=True)
File "/home/human-machine/Speech/deep-voice-conversion-master/train1.py", line 57, in train
sess.run(train_op)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 789, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 997, in _run
feed_dict_string, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1132, in _do_run
target_list, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1152, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.OutOfRangeError: PaddingFIFOQueue '_1_batch/padding_fifo_queue' is closed and has insufficient elements (requested 32, current size 0)

[[Node: batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](batch/padding_fifo_queue, batch/n)]]


解决方法:

https://github.com/davidsandberg/facenet/issues/338

https://github.com/tensorflow/tensorflow/issues/1045

https://stackoverflow.com/questions/34050071/tensorflow-random-shuffle-queue-is-closed-and-has-insufficient-elements

https://tutel.me/c/programming/questions/45189978/tftrainbatch+is+showing+insufficient+elements

with tf.Session() as sess:    # sess.run(tf.group(tf.local_variables_initializer(),tf.global_variables_initializer()))
    sess.run(tf.local_variables_initializer())
    sess.run(tf.global_variables_initializer())
    coord = tf.train.Coordinator()
    threads = tf.train.start_queue_runners(coord=coord)
    # do your stuff here
    coord.request_stop()
    coord.join(threads)

参考博客:https://blog.csdn.net/u013555719/article/details/77851864

tensorflow.python.framework.errors_impl.OutOfRangeError: FIFOQueue

今天遇到了这个问题

tensorflow.python.framework.errors_impl.OutOfRangeError:
FIFOQueue '_0_input_producer' is closed and has insufficient elements (requested 1, current size 0)
     [[Node: ReaderReadV2 = ReaderReadV2[_device="/job:localhost/replica:0/task:0/cpu:0"](WholeFileReaderV2, input_producer)]]  

经过查找资料:local变量没有初始化. 
初始化变量语句改成:

init_op = tf.group(tf.global_variables_initializer(), tf.local_variables_initializer()) 
sess.run(init_op) 


猜你喜欢

转载自blog.csdn.net/qq_34638161/article/details/80387829
今日推荐