EasyOCR icon indicating copy to clipboard operation
EasyOCR copied to clipboard

UnboundLocalError in recognizer_predict when preds_str not initialized

Open RUTUPARNk opened this issue 6 months ago • 0 comments

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

RUTUPARNk avatar Jun 26 '25 07:06 RUTUPARNk