How to read images in the correct order with minibatchqueue?

5 ビュー (過去 30 日間)
Huhufly
Huhufly 2022 年 1 月 18 日
回答済み: yanqi liu 2022 年 1 月 19 日
I was trying to do CNN predictions using a customely trained dlnetwork. While I was trying to feed minibatch data to the network using minibatchqueue for prediction, I found that the image index of the first and the next minibatch was not sequential. Does anyone know how to read data with minibatchqueue object in a correct order?
Thanks!
  1 件のコメント
Tomaso Cetto
Tomaso Cetto 2022 年 1 月 18 日
Hi there!
The order in which minibatchqueue returns images is most often dependent on the nature of the underlying datastore. By default minibatchqueue will return mini-batches in the same order as the datastore "read" outputs. What datastore are you using? It might be that the datastore is shuffling its data every time it reads it out. It might also be that there is a call to shuffle(minibatchqueue) somewhere in your code.
Another thing which could affect the order in which the images are read out is the use of the DispatchInBackground option of the minibatchqueue object. It's better not to use this option in this case.
Let me know if any of this applies to your case!
Tomaso

サインインしてコメントする。

回答 (1 件)

yanqi liu
yanqi liu 2022 年 1 月 19 日
yes,sir,may be set trainingOptions,such as
'Shuffle', 'never'
to make it do not shuffle data order,in common,we offen use
'Shuffle','every-epoch'
to make train more stable

カテゴリ

Help Center および File ExchangePreprocess Data for Deep Neural Networks についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by