Reputation: 1
epochs = 150
callbacks_list=[ModelCheckpoint(save_best_only=False,filepath=checkpoint_path),TensorBoard(log_dir='logs')]
history = model.fit(generator=gen_tr,steps_per_epoch=200,
epochs=epochs,
validation_data=gen_val,
validation_steps=1,
callbacks = callbacks_list )
Error message- TypeError : fit() got an unexpected keyword argument 'generator'
In documentation it is written that Model.fit supports generator now, but still it shows error.
Upvotes: 0
Views: 6051
Reputation: 21
Model.fit() takes in the generator. But remove keyword generator.
model.fit(generate_batch(X_train, y_train, batch_size = batch_size),...)
Upvotes: 2
Reputation:
From comments
epochs = 150 callbacks_list=[ModelCheckpoint(save_best_only=False,filepath=checkpoint_path),TensorBoard(log_dir='logs')] history = model.fit(gen_tr,steps_per_epoch=200, epochs=epochs, validation_data=gen_val, validation_steps=1, callbacks = callbacks_list )
(paraphrased from Frightera)
For more details you can refer model.fit.
Upvotes: 0