Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finetuning the recognizer crashes when reaching the fit_generator method #240

Open
jnluca opened this issue Sep 8, 2023 · 0 comments
Open

Comments

@jnluca
Copy link

jnluca commented Sep 8, 2023

Hi, the code provided to finetune the recognizer is not working anymore. When I open your example keras_ocr_born_digital_public.ipynb on Colab and run it, the fit_generator method crashes with the following message:

Epoch 1/1000

ValueError Traceback (most recent call last)
in <cell line: 1>()
----> 1 recognizer.training_model.fit(
2 final_train_gen(training_gen),
3 batch_size=1,
4 steps_per_epoch=training_steps,
5 validation_steps=validation_steps,

1 frames
/usr/local/lib/python3.10/dist-packages/keras/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:

File "/usr/local/lib/python3.10/dist-packages/keras/engine/training.py", line 1284, in train_function  *
    return step_function(self, iterator)
File "/usr/local/lib/python3.10/dist-packages/keras/engine/training.py", line 1268, in step_function  **
    outputs = model.distribute_strategy.run(run_step, args=(data,))
File "/usr/local/lib/python3.10/dist-packages/keras/engine/training.py", line 1249, in run_step  **
    outputs = model.train_step(data)
File "/usr/local/lib/python3.10/dist-packages/keras/engine/training.py", line 1050, in train_step
    y_pred = self(x, training=True)
File "/usr/local/lib/python3.10/dist-packages/keras/utils/traceback_utils.py", line 70, in error_handler
    raise e.with_traceback(filtered_tb) from None

ValueError: Exception encountered when calling layer 'lambda_1' (type Lambda).

None values not supported.

Call arguments received by layer 'lambda_1' (type Lambda):
  • inputs=['tf.Tensor(shape=(None, None, None, 512), dtype=float32)', 'tf.Tensor(shape=(None, 6), dtype=float32)']
  • mask=None
  • training=True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant