tesseract-ocr / tesstrain

Train Tesseract LSTM with make
Apache License 2.0
599 stars 178 forks source link

make trained model from checkpoint files #331

Open z160896 opened 1 year ago

z160896 commented 1 year ago

@zdenop I have come to the last hurdle! I can finish training the model successfully. I like to make the trained model from files in checkpoints dir from the instruction. can you help how to get it work. appreciated.

steps: 1) make traineddata MODEL_NAME=hwmodel OUTPUT_DIR=data/hwmodel 2) make training MODEL_NAME=hwmodel START_MODEL=eng LANG_TYPE=Eng 3) make traineddata CHECKPOINT_FILES="$(find data/hwmodel/checkpoints -name '*.checkpoint' -mtime -21)" MODEL_NAME=hwmodel OUTPUT_DIR=/mnt/d/git make: *** No rule to make target 'data/hwmodel/tessdata_best/hwmodel_19.699000_9449_9800.checkpoint data/hwmodel/tessdata_best/hwmodel_20.407000_7080_7300.checkpoint data/hwmodel/tessdata_best/hwmodel_21.067000_6516_6700.checkpoint data/hwmodel/tessdata_best/hwmodel_21.878000_6042_6200.checkpoint data/hwmodel/tessdata_best/hwmodel_22.593000_4598_4700.checkpoint data/hwmodel/tessdata_best/hwmodel_23.559000_4120_4200.checkpoint data/hwmodel/tessdata_best/hwmodel_24.341000_3831_3900.checkpoint data/hwmodel/tessdata_best/hwmodel_25.543000_2463_2500.checkpoint data/hwmodel/tessdata_best/hwmodel_26.484000_2271_2300.checkpoint data/hwmodel/tessdata_best/hwmodel_27.441000_1980_2000.checkpoint data/hwmodel/tessdata_best/hwmodel_28.992000_1683_1700.checkpoint data/hwmodel/tessdata_best/hwmodel_30.096000_1491_1500.checkpoint data/hwmodel/tessdata_best/hwmodel_31.523000_1193_1200.checkpoint data/hwmodel/tessdata_best/hwmodel_32.787000_1093_1100.checkpoint data/hwmodel/tessdata_best/hwmodel_35.179000_796_800.checkpoint data/hwmodel/tessdata_best/hwmodel_36.494000_597_600.checkpoint data/hwmodel/tessdata_best/hwmodel_38.070000_399_400.checkpoint data/hwmodel/tessdata_best/hwmodel_39.380000_300_300.checkpoint data/hwmodel/tessdata_best/hwmodel_42.453000_200_200.checkpoint data/hwmodel/tessdata_best/hwmodel_45.193000_100_100.traineddata', needed by 'traineddata'. Stop.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

bertsky commented 4 months ago

@z160896 to convert a checkpoint to a traineddata file, just do:

lstmtraining --stop_training --continue_from path/to/checkpoint --traineddata path/to/proto.traineddata --model_output path/to/trainedata

In your case, that should be:

lstmtraining --stop_training --continue_from data/hwmodel/tessdata_best/hwmodel_19.699000_9449_9800.checkpoint --traineddata data/hwmodel/hwmodel.traineddata --model_output data/hwmodel.traineddata