Skip to content

Model.fit_generator` is deprecated in braai_train.ipynb #9

@DRA-chaos

Description

@DRA-chaos

Model.fit_generator is obsolete. I have been trying tf.keras.Model() but that does not execute without errors. Model.fit does not work either when it comes to training models with generators

the following is the error message :
:4: UserWarning: Model.fit_generator is deprecated and will be removed in a future version. Please use Model.fit, which supports generators.
h = model.fit_generator(training_generator,
Epoch 1/100

ValueError Traceback (most recent call last)
in <cell line: 4>()
2 model_name = f'braai_{model.name}_{run_t_stamp}'
3
----> 4 h = model.fit_generator(training_generator,
5 steps_per_epoch=len(x_train) // batch_size,
6 validation_data=validation_generator,

2 frames
/usr/local/lib/python3.10/dist-packages/keras/src/engine/training.py in tf__train_function(iterator)
13 try:
14 do_return = True
---> 15 retval_ = ag__.converted_call(ag__.ld(step_function), (ag__.ld(self), ag__.ld(iterator)), None, fscope)
16 except:
17 do_return = False

ValueError: in user code:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions