ImageDataGenerator生成器的flow_from_directory()的用法
train_generator = train_datagen.flow_from_directory(
train_data_dir,
target_size=(img_height, img_width),
batch_size=batch_size,
class_mode='categorical')
validation_generator = test_datagen.flow_from_directory(
validation_data_dir,
target_size=(img_height, img_width),
batch_size=batch_size,
class_mode='categorical')
flow_from_directory : flow_from_directory(directory):
以文件夹路径为参数,生成经过数据提升/归一化后的数据,在一个无限循环中无限产生batch数据
directory: 目标文件夹路径,对于每
ImageDataGenerator生成器的flow_from_directory()的用法最先出现在Python成神之路。
共有 0 条评论