在训练模型的时候遇到了以下问题:
OutOfRangeError (see above for traceback): RandomShuffleQueue '_2_shuffle_batch_join/random_shuffle_queue' is closed and has insufficient elements (requested 10, current size 0)
[[Node: shuffle_batch_join = QueueDequeueManyV2[component_types=[DT_UINT8, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_INT64, DT_STRING], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](shuffle_batch_join/random_shuffle_queue, shuffle_batch_join/n)]]
[[Node: strided_slice_10/_1151 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_3784_strided_slice_10", tensor_type=DT_UINT8, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]
引起这个问题有很多的原因,我这边是因为在生成TFRecords文件的时候,有的example遇到了错误,比如图像是空的。所以加入检测这种错误的代码,然后就解决了。
转载:https://blog.csdn.net/wz22881916/article/details/101033558