tensorflow加载jpeg图片时报错OutOfRangeError (see above for traceback): FIFOQueue '_1_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)]]
1.将decode_jpg(image_file)改为decode_image(image_file,channels=3)错误依旧
2.查找资料后终于找到解决办法:因为局部变量(local variables)没有初始化,将初始化变量语句改为
全局变量初始化:tf.global_variables_initializer().run()
局部变量初始化:tf.local_variables_initializer().run()