我已经从png图像生成了一个盒子文件,然后按照本教程进行操作: https://pretius.com/how-to-prepare-training-files-for-tesseract-ocr-and-improve-characters-recognition/生成自定义的训练数据文件。
当我尝试将生成的训练数据与Pytesseract一起使用时遇到错误。 而我得到了这样的错误:
raise TesseractError(proc.returncode, get_errors(error_string))
pytesseract.pytesseract.TesseractError: (-4, "read_params_file:
Can't open txt read_params_file: Can't open txt read_params_file: Can't open txt read_params_file: Can't open txt Error: LSTM requested, but not present!! Loading tesseract. mgr->GetComponent(TESSDATA_NORMPROTO, &fp)
:Error:Assert failed:in file adaptmatch.cpp, line 552")
我正在使用Tesseract 5.0版
这是我的配置选项
traineddata = f'+eng+lav+lav2'
config = f'-l {traineddata} --oem 1 --psm 3 {tessdata_dir}'
答案 0 :(得分:1)
我遵循相同的教程,并遇到了完全相同的错误。在我的第一次尝试中,***。traineddata生成的不好,并且我发现一个文件丢失了(normproto)。因此,我只是清理了所有生成的文件(纠正后的.box文件除外),然后重新运行训练过程,第二次尝试一切正常。