【发布时间】:2021-07-10 06:08:12
【问题描述】:
有人可以告诉我 ImageDataGenerator 是在训练时采用随机批次的原始数据,还是在每个 epoch 中按顺序采用,例如第一次迭代中的前 100 个样本,第二次迭代中的后 100 个样本,等等在? 我需要理解这一点,因为我正在训练一个卷积自动编码器,并且输入也作为输出在 model.fit() 中传递。所以两者都应该正确对应。
数据集有 3200 张大小为 360x640 的图像。截至目前,我有这个:
gen = ImageDataGenerator()
train_im = ImageDataGenerator(
rescale=1./255,
shear_range=0.2,
horizontal_flip=False)
def train_images():
train_generator = train_im.flow_from_directory (
'train_frames',
target_size=(360, 640),
color_mode='rgb',
batch_size=100,
shuffle = True,
class_mode='categorical')
x = train_generator
return x[0][0], x[0][1]
【问题讨论】:
标签: python keras autoencoder