I'm using ImageDataGenerator with flow_from_dataframe to load a dataset.
Using flow_from_dataframe
with shuffle=True
shuffles the images in the dataset.
I want to shuffle the batches. If I have 12 images and batch_size=3
, then I have 4 batches:
batch1 = [image1, image2, image3]
batch2 = [image4, image5, image6]
batch3 = [image7, image8, image9]
batch4 = [image10, image11, image12]
I want to shuffle the batches without shuffling the images in each batch, so that I get for example:
batch2 = [image4, image5, image6]
batch1 = [image1, image2, image3]
batch4 = [image10, image11, image12]
batch3 = [image7, image8, image9]
Is that possible with ImageDataGenerator and flow_from_dataframe? Is there a preprocessing function I can use?
question from:
https://stackoverflow.com/questions/65942274/how-to-shuffle-batches-with-imagedatagenerator 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…