Skip to content Skip to sidebar Skip to footer

Multi-classification Nn With Keras Error

I am getting an error when trying to do multi-classification with three classes. Error: TypeError: fit_generator() got multiple values for argument 'steps_per_epoch' Code Giving

Solution 1:

The Keras documentation provides the following definition for fit_generator:

fit_generator(self, generator, steps_per_epoch=None, epochs=1, verbose=1, callbacks=None, validation_data=None, validation_steps=None, class_weight=None, max_queue_size=10, workers=1, use_multiprocessing=False, shuffle=True, initial_epoch=0)

You have provided two positional arguments:

  • train_set - this got assigned to generator
  • train_labels - this got assigned to steps_per_epoch

But then you provide another (now keyword argument) steps_per_epoch, hence the error.

Post a Comment for "Multi-classification Nn With Keras Error"