load jpeg with tensorflow-FIFOQueue '_1_input_producer' is closed and has insufficient elements()

来源:互联网 发布:香港衰落 知乎 编辑:程序博客网 时间:2024/06/06 05:35

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()


阅读全文
1 0
原创粉丝点击