Closed walkadda closed 4 months ago
Hi @walkadda -
Thanks for reporting the issue. I have tested the code snippet and reproduces the reported behaviour. Attached gist file for reference. We will look into the issue and update you the same.
Hi @walkadda -
There needs to be change at few lines in handwritten recognition code.
predictions_decoded = keras.ops.nn.ctc_decode(predictions, sequence_lengths=input_len)[0][0][:, :max_len]
prediction_model = keras.models.Model(model.get_layer(name="image").output, model.get_layer(name="dense2").output)
results = keras.ops.nn.ctc_decode(pred, sequence_lengths=input_len)[0][0][:, :max_len]
Here is the gist attached for the reference where you find the changes.
This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.
This issue was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further.
Environment:
I've been following this guide from Keras' official site to create a handwritten text recognition model (HTR) in Python https://keras.io/examples/vision/handwriting_recognition/ but have run into some issues opening & reading the dataset from this GitHub download link (https://github.com/sayakpaul/Handwriting-Recognizer-in-Keras/releases/download/v1.0.0/IAM_Words.zip).
I've updated the code in a few places if and when I spot problems, but it's failing when the model training starts:
This is the problematic code:
Train the model.
All of the pictures are .png and haven't been edited from the original dataset. I've also downloaded the dataset from a few different places just to test if they've become corrupted.
Here's the code that builds the model:
There's probably important info that I've missed, but I've added all I can think to at the moment. Thank you for all the help.