openalpr / train-ocr

Input files and scripts necessary to train the license plate OCR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to create .traineddata file from box and tif for Indonesian license plate

reza4836 opened this issue · comments

Greetings Matt, I have an issue when executing the last step for training Indonesian country with openALPR. In the train-ocr rep, the last step ("Training the OCR") describes that we have to execute the "train.py" to generate .traineddata file (in my case would be lid.traineddata if success) from .box and .tif file. From this step, I completely stuck because this program gives 'permission denied' error in the tessdata directory, even if I already changed the permission state by chmod in order to give permission of train.py to change, read, and write the tessdata directory.

Here's the directory from code:

TESSERACT_DIR='/media/gspeintercon/GSPE1/GIT/tesseract-4.0.0-beta.1'
os.environ["TESSDATA_PREFIX"] = '/media/gspeintercon/GSPE1/GIT/tesseract-4.0.0-beta.1'
os.system("export TESSDATA_PREFIX=" + '/media/gspeintercon/GSPE1/GIT/tesseract-4.0.0-beta.1')
TESSERACT_BIN= '/media/gspeintercon/GSPE1/GIT/tesseract-4.0.0-beta.1/tessdata'
TESSERACT_TRAINDIR= '/media/gspeintercon/GSPE1/GIT/tesseract-4.0.0-beta.1/training'

Here's the error result:

$ sudo python train.py
Two-Letter Country Code to Train: id
Processing: ./id/input/lid.indonesia.exp0.box
Executing: /media/gspeintercon/GSPE1/GIT/tesseract-4.0.0-beta.1/tessdata -l eng ./id/input/lid.indonesia.exp0.tif lid.indonesia.exp0 nobatch box.train.stderr
sh: 1: /media/gspeintercon/GSPE1/GIT/tesseract-4.0.0-beta.1/tessdata: Permission denied
mv: cannot stat './lid.indonesia.exp0.tr': No such file or directory
mv: cannot stat './lid.indonesia.exp0.txt': No such file or directory
Extracting unicharset from box file ./id/input/lid.indonesia.exp0.box
Other case a of A is not in unicharset
Other case b of B is not in unicharset
Other case c of C is not in unicharset
Other case d of D is not in unicharset
Other case e of E is not in unicharset
Other case f of F is not in unicharset
Other case g of G is not in unicharset
Other case h of H is not in unicharset
Other case i of I is not in unicharset
Other case j of J is not in unicharset
Other case k of K is not in unicharset
Other case l of L is not in unicharset
Other case m of M is not in unicharset
Other case n of N is not in unicharset
Other case o of O is not in unicharset
Other case p of P is not in unicharset
Other case q of Q is not in unicharset
Other case r of R is not in unicharset
Other case s of S is not in unicharset
Other case t of T is not in unicharset
Other case u of U is not in unicharset
Other case v of V is not in unicharset
Other case w of W is not in unicharset
Other case x of X is not in unicharset
Other case y of Y is not in unicharset
Other case z of Z is not in unicharset
Wrote unicharset file unicharset
Executing: /media/gspeintercon/GSPE1/GIT/tesseract-4.0.0-beta.1/training/mftraining -F ./tmp/font_properties -U unicharset -O ./tmp/lid.unicharset ./tmp/.tr
Warning: No shape table file present: shapetable
Reading ./tmp/
.tr ...

Error: Unable to open ./tmp/.tr!
"Fatal error encountered!" == NULL:Error:Assert failed:in file globaloc.cpp, line 75
Segmentation fault (core dumped)
mv: cannot stat './tmp/lid.unicharset': No such file or directory
cp: cannot stat './id/input/unicharambigs': No such file or directory
Reading ./tmp/
.tr ...

Error: Unable to open ./tmp/*.tr!
"Fatal error encountered!" == NULL:Error:Assert failed:in file globaloc.cpp, line 75
Segmentation fault (core dumped)
mv: cannot stat './shapetable': No such file or directory
mv: cannot stat './pffmtable': No such file or directory
mv: cannot stat './inttemp': No such file or directory
mv: cannot stat './normproto': No such file or directory
Combining tessdata files
Error: traineddata file must contain at least (a unicharset fileand inttemp) OR an lstm file.
Error combining tessdata files into lid.traineddata
Version string:4.00.00alpha
23:version:size=12, offset=192
mv: cannot stat './lid.unicharset': No such file or directory
mv: cannot stat './lid.shapetable': No such file or directory
mv: cannot stat './lid.pffmtable': No such file or directory
mv: cannot stat './lid.inttemp': No such file or directory
mv: cannot stat './lid.normproto': No such file or directory
mv: cannot stat './lid.unicharambigs': No such file or directory

Can you help me where was my error cause, I tried it with another country which the box and tif file was available from the repo but still can't generate the .traineddata file and gives same error. Thank you.

I got the same issue .have u been able to fix that?