faustomorales / keras-ocr

A packaged and flexible version of the CRAFT text detector and Keras CRNN recognition model.
https://keras-ocr.readthedocs.io/
MIT License
1.36k stars 347 forks source link

Can load pretrain custom digits model #215

Closed phamkhactu closed 1 year ago

phamkhactu commented 1 year ago

Thank for greate repo @faustomorales. I follow the tutorial from tutorial custom train digits. The model save, I can not load pretrained model.

I load model:

recognizer = keras_ocr.recognition.Recognizer(
    alphabet=alphabet,
    weights='custom_model.h5'
    )

Error show that when I load

 File "/home/tupk/anaconda3/envs/ocr/lib/python3.8/site-packages/keras_ocr/recognition.py", line 376, in __init__
    build_params = build_params or PRETRAINED_WEIGHTS[weights]["build_params"]

But with tutorial from start to end, I don't get any err.

Many thank for your reponse.