【发布时间】:2019-08-22 16:36:29
【问题描述】:
首先,非常感谢您阅读我的问题。
TensorFlow 版本:TensorFlow-GPU 1.14
操作系统:ubuntu 16.04
tensorflow.python.framework.errors_impl.OutOfRangeError: RandomShuffleQueue '_1_shuffle_batch/random_shuffle_queue' is closed and has insufficient elements (requested 8, current size 7)
[[{{node shuffle_batch}}]]
我正在测试一种称为“Goturn”的 CNN,并使用 TensorFlow 实现它。当我使用 100,000 多张图像来训练我的网络时,它总是显示此错误。奇怪的是,除了第一轮训练之外,训练过程中都会显示错误。
我已经尝试了很多stackoverflow、CSDN和其他网站的解决方案,但没有用。大多数建议是修改 tf.train.shuffle_batch() 的元素,而我应该如何选择它们,有什么规定要遵守吗?谢谢阅读。任何建议将不胜感激
def next_batch(input_queue):
min_queue_examples = 8
num_threads = 2
[search_tensor, target_tensor, box_tensor] = data_reader(input_queue)
[search_batch, target_batch, box_batch] = tf.train.shuffle_batch(
[search_tensor, target_tensor, box_tensor],
batch_size=8,
num_threads=num_threads,
seed=88,
min_after_dequeue=min_queue_examples,
capacity=min_queue_examples+3*BATCH_SIZE)
print("next_batch!!!!!")
return [search_batch, target_batch,
box_batch, input_queue[0], input_queue[1]]
【问题讨论】:
标签: python tensorflow