0

I have generated a box file from a png image then I followed this tutorial: https://pretius.com/how-to-prepare-training-files-for-tesseract-ocr-and-improve-characters-recognition/ to generate custom traineddata file.

I encountered an error when I tried to use the generated traineddata alongside with Pytesseract. and i got this kind of error:

  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")

I'm using Tesseract version 5.0

This is my config options

traineddata = f'+eng+lav+lav2'
config = f'-l {traineddata} --oem 1 --psm 3 {tessdata_dir}'
Andrew
  • 1,507
  • 1
  • 22
  • 42

1 Answers1

1

I followed the same tutorial and encountered the exact same error. At my first tries the ***.traineddata didn't generated well, and I findout that one file was missing (normproto). So I just cleaned all the generated files (except the corrected .box files) and rerun the train process, and everything worked fine on the second attempt.

Kasonnara
  • 91
  • 4