Tensorflow FIFOQueue error: FIFOQueue is closed and has insufficient elements

前端 未结 4 1565
眼角桃花
眼角桃花 2021-01-19 03:03

Now I am using tensorflow to write a program to validate models. I use the FIFOQueue to queue the input data. For example, I have 50,000 images and enqueue 100 images at a t

相关标签:
4条回答
  • 2021-01-19 03:33

    Try dequeue_up_to instead of dequeue_many: https://www.tensorflow.org/versions/r0.10/api_docs/python/io_ops.html

    Hope that helps!

    0 讨论(0)
  • 2021-01-19 03:46

    I have faced this issue multiple times and from my experience this is usually caused if the input files cannot be found. my input was a list of pngs from a directory and I was using this to get the input images.

    input = tensorflow.train.string_input_producer(tensorflow.train.match_filenames_once("/input/*.png"))
    

    which was somehow not getting the files correctly. Changing it to

    filename_im = tensorflow.train.string_input_producer(glob.glob('/input/*.png'))
    

    solved the issue

    0 讨论(0)
  • 2021-01-19 03:47

    You could catch the specific error which will gracefully end training once all examples have been exhausted:

    try:
        while True:
            # Run training Ops here...
    
    except tf.errors.OutOfRangeError:
        print('Done training -- epoch limit reached')
    
    0 讨论(0)
  • 2021-01-19 03:48

    I believe that this is only a warning that the queue is empty, but does not cause errors. I see similar warnings but my program does not break. Does yours? See this thread.

    0 讨论(0)
提交回复
热议问题