1. 程式人生 > >OutOfRangeError (see above for traceback)+OutOfRangeError : RandomShuffleQueue

OutOfRangeError (see above for traceback)+OutOfRangeError : RandomShuffleQueue

TFRecordReader "OutOfRangeError (see above for traceback): RandomShuffleQueue '_1_shuffle_batch/random_shuffle_queue' is closed and has insufficient elements (requested 1, current size 0)" 問題原因總結;

1. tf.decode_raw(features['image_raw'],tf.uint8) 解碼時,資料型別有沒有錯?tf.float32 和tf.uint8有沒有弄混???

2. tf.train.string_input_producer([data_file],num_epochs=1) 如果設定num_epochs=1引數,請新增上 tf.local_variables_initializer()

3. 你的資料集通道有沒有搞錯?真的都是三通道或者都是單通道麼?有沒有可能單通道影象混在在三通道影象當中呢?

4. 影象的大小之前resize了麼?前後一直麼?

 

總結一下:一般遇到這個錯誤,程式碼本身沒有問題,基本上都是引數不一致導致的,注意檢查各個引數。

 

理解tfrecord讀取資料——錯誤OutOfRangeError (see above for traceback)的解決

https://blog.csdn.net/qq_37274615/article/details/81110251

OutOfRangeError : RandomShuffleQueue

https://blog.csdn.net/qq_34638161/article/details/80752596