Я пытаюсь обучить cnn изображениям, хранящимся в папке с именем «Здоровье».
train_data_dir = "Health"
train_datagen = ImageDataGenerator(rescale = 1./256,
rotation_range = 360,
width_shift_range=0.1,
height_shift_range=0.1,
zoom_range=10,
horizontal_flip=True,
vertical_flip=True,
data_format ="channels_last",validation_split=0.2)
train_generator = train_datagen.flow_from_directory(train_data_dir,
target_size =(img_width, img_height),
batch_size = batch_size,
class_mode = None,
subset='training')
validation_generator = train_datagen.flow_from_directory(train_data_dir,
target_size =(img_width, img_height),
batch_size = batch_size,
class_mode =None,
subset='validation')
history = model.fit_generator(generator=train_generator,
steps_per_epoch=train_generator.samples//batch_size,
epochs=10,
validation_data=validation_generator,
validation_steps=validation_generator.samples//batch_size)
Я получаю следующую ошибку:
ValueError: Output of generator should be a tuple `(x, y, sample_weight)` or `(x, y)`. Found: [[[[0. 0. 0. ]
Что я делаю не так?