Skip to content

UnboundLocalError in recognizer_predict when preds_str not initialized #1415

@RUTUPARNk

Description

@RUTUPARNk

Summary

Calling reader.readtext() with decoder='tesseract' (or under some internal conditions) causes this error:

UnboundLocalError: cannot access local variable 'preds_str' where it is not associated with a value

Repro Steps

import easyocr
reader = easyocr.Reader(['en'], gpu=False)
reader.readtext('test_image.png', decoder='tesseract')

Traceback

    for pred, pred_max_prob in zip(preds_str, preds_max_prob):
UnboundLocalError: cannot access local variable 'preds_str' where it is not associated with a value

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions