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 CenterFile Exchange에서 Preprocess 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