TensorFlow random_shuffle_queue is closed and has insufficient elements

后端 未结 6 1288
借酒劲吻你
借酒劲吻你 2020-12-15 05:00

I\'m reading batch of images by getting idea here from tfrecords(converted by this)

My images are cifar images, [32, 32, 3] and as you can see while reading and pas

6条回答
  •  天命终不由人
    2020-12-15 05:48

    I had this same problem and none of the previous answers seemed to solve it so I will also chime in.

    For me the problem ended up being the features list I was passing to parse_single_example. For whatever reason (since I am using a float_list ?) in my tfrecords file I needed to specify the length of the array in my features list or use tf.VarLenFeature ie:

    feature_structure = {'features': tf.FixedLenFeature([FEATURE_SIZE], tf.float32),
               'outputs': tf.FixedLenFeature([OUTPUT_SIZE], tf.float32)}
    d_features = tf.parse_single_example(serialized_example, features=feature_structure)
    

    Without this I kept getting the "random_shuffle_queue is closed and has insufficient elements" error which I am guessing is because my parsed example had no data in it.

提交回复
热议问题