OCR模型

用的這個效果不錯

app端:https://github.com/chineseocr/chineseocr

訓練ocr端:https://codeload.github.com/chineseocr/chineseocr/zip/master

 

環境配置:

conda install pytorch torchvision cpuonly -c pytorch

WINDOWS下安裝CTC FROM WARPCTC_PYTORCH IMPORT CTCLOSS

根據:https://www.freesion.com/article/5487477118/

模型轉換:

pytorch ocr 轉keras ocrpython .\pytorch_to_keras.py -weights_path models/ocr-english.pth -output_path models/ocr-english.h5

 

遇到的bug:

keras——ValueError: You are trying to load a weight file containing 12 layers into a model with 2 layers.

model=load_model('./model/my_model_weights.h5')

改爲:

model.load_weights('test.h5',by_name=True) 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章