用tensorflow构建队列时报错runtimeerror。

file_queue = tf.train.string_input_producer(file_list, shuffle=False)这一行报错,报错信息:RuntimeError: Input pipelines based on Queues are not supported when eager execution is enabled. Please use tf.data to ingest data into your model instead.代码如下

def get_captcha_image():

    filename = []

    for i in range(5000):
        string = str(i) + '.jpg'
        filename.append(string)

    file_list = [os.path.join(FLAGS.captcha_dir, file) for file in filename]

    file_queue = tf.train.string_input_producer(file_list, shuffle=False)

    reader = tf.WholeFileReader()

    key, value = reader.read(file_queue)

    image = tf.image.decode_jpeg(value)

    image.set_shape([40, 120, 3])

    image_batch = tf.train.batch([image], batch_size=5000, num_threads=1, capacity=32)

    return image_batch

me too

https://blog.csdn.net/qq_23077585/article/details/103390579