报错:OutOfRangeError: FIFOQueue '_1_batch/fifo_queue' is closed and has insufficient elements 解决办法

  Tensorflow在跑图像数据时报错,报错信息如下:

OutOfRangeError (see above for traceback): FIFOQueue '_1_batch/fifo_queue' is closed and has insufficient elements (requested 8, current size 1)
	 [[Node: batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_UINT8], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](batch/fifo_queue, batch/n)]]

  信息显示读取数据队列出现问题,刚开始一直以为是  tf.train.shuffle_batch参数出现问题,于是不断调参数,但均无效。

tf.train.shuffle_batch(
      tensors,
      batch_size = 16,
      capacity = 512,  # 这个参数多次调整,无效
      min_after_dequeue = 128,  # 这个参数多次调整,无效
      keep_input=True,
      num_threads=num_threads,  # 这个参数调整多次,无效
      seed=seed,
      enqueue_many=enqueue_many,
      shapes=shapes,
      allow_smaller_final_batch=allow_smaller_final_batch,
      shared_name=shared_name,
      name=name)

  最终解决方法:原始数据问题,存在一张异常照片,删除即可。

  最后在检查数据的时候,发现原始数据中存在一张异常照片,删除即恢复正常。

  所以,当遇到类似问题时,请先检查原始数据,可能并不是程序本身的错误。

“Image_295”为异常图片
 

 

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值