Skip to content Skip to sidebar Skip to footer

When Passing Input Data As Arrays, Do Not Specify `steps_per_epoch`/`steps` Argument. Please Use `batch_size` Instead

My code is below : model.fit_generator(generator=(train_image_list, train_mask_list),epochs=1000,shuffle=True) Both the train_image_list and train_mask_list contains image lists.W

Solution 1:

It means that you should use the normal fit() method, and specify the batch_size argument rather than passing arrays as generators.

model.fit(train_image_list, train_mask_list, epochs=1000, batch_size=32)

From the documentation of fit_generator():

generator: A generator or an instance of Sequence (keras.utils.Sequence) object in order to avoid duplicate data when using multiprocessing. The output of the generator must be either a tuple (inputs, targets)...

You're passing arrays, not a generator object. So Keras is telling you that you can't use fit_generator this way.

Post a Comment for "When Passing Input Data As Arrays, Do Not Specify `steps_per_epoch`/`steps` Argument. Please Use `batch_size` Instead"