forked from mittagessen/kraken
-
Notifications
You must be signed in to change notification settings - Fork 0
Training German Handwriting
Stefan Weil edited this page Dec 5, 2022
·
14 revisions
Tobias GrΓΌning, Gundram Leifert, Johannes Michael, Tobias StrauΓ, Max Weidemann, Roger Labahn. (2016). read_dataset_german_konzilsprotokolle [Data set]. Zenodo. http://doi.org/10.5281/zenodo.215383
SΓ‘nchez, Joan Andreu, Romero, VerΓ³nica, Toselli, Alejandro H., & Vidal, Enrique. (2016). READ dataset Bozen [Data set]. Zenodo. https://doi.org/10.5281/zenodo.218236
Hodel, Tobias, Schoch, David, & DΓ€ngeli, Peter. (2021). Handwritten Text Recognition Ground Truth Set: StABS RatsbΓΌcher O10, Urfehdenbuch X (1.0) [Data set]. Zenodo. https://doi.org/10.5281/zenodo.5153263
wget -m https://zenodo.org/record/215383/files/german_konzilsprotokolle.tar.gz
tar xzf zenodo.org/record/215383/files/german_konzilsprotokolle.tar.gz
(
cd gt/215383/...
for dir in Copy_of_*; do (cd $dir; ln -sv page/*.xml .); done
)
wget -m https://zenodo.org/record/218236/files/PublicData.tgz
tar xzf zenodo.org/record/218236/files/PublicData.tgz
wget -m https://zenodo.org/record/5153263/files/StABS_Ratsbuch_O_10.zip
unzip zenodo.org/record/5153263/files/StABS_Ratsbuch_O_10.zip
cd gt/5153263/StABS_Ratsbuch_O_10/page
ln -sv ../*.jpg ../*.png .
for in in *.jpg; do out=$(echo $in|sed s/Rats.*_0*//); mv -v $in $out; done
ls gt/215383/german_konzilsprotokolle/data/Greifswald_Alvermann/Copy_of_*/0*.xml >>list.train
ls gt/218236/PublicData/*/page/*xml >>list.train
ls gt/5153263/StABS_Ratsbuch_O_10/page/*.xml >>list.train
ls digitue/*/*xml >> list.train
shuf < list.train | shuf >list1.train
ketos train -d cuda:0 --workers 4 -f xml Handschriften/gt/215383/german_konzilsprotokolle/data/Greifswald_Alvermann/Copy_of_*/0*.xml
about 24 min / epoch
(venv3.9) stweil@ocr-02:~/src/github/mittagessen/kraken/Handschriften$ ketos pretrain -d cuda:0 -f page -t list.shuf.train -o pretrain/german_handwriting
GPU available: True (cuda), used: True
TPU available: False, using: 0 TPU cores
IPU available: False, using: 0 IPUs
HPU available: False, using: 0 HPUs
`Trainer(val_check_interval=1.0)` was configured so validation will run at the end of the training epoch..
LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
ββββββ³βββββββββββββββββββββββββ³βββββββββββββββββββββββββββ³βββββββββ
β β Name β Type β Params β
β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β 0 β net β MultiParamSequential β 4.0 M β
β 1 β net.C_0 β ActConv2D β 1.3 K β
β 2 β net.Do_1 β Dropout β 0 β
β 3 β net.Mp_2 β MaxPool β 0 β
β 4 β net.C_3 β ActConv2D β 40.0 K β
β 5 β net.Do_4 β Dropout β 0 β
β 6 β net.Mp_5 β MaxPool β 0 β
β 7 β net.C_6 β ActConv2D β 55.4 K β
β 8 β net.Do_7 β Dropout β 0 β
β 9 β net.Mp_8 β MaxPool β 0 β
β 10 β net.C_9 β ActConv2D β 110 K β
β 11 β net.Do_10 β Dropout β 0 β
β 12 β net.S_11 β Reshape β 0 β
β 13 β net.L_12 β TransposedSummarizingRNN β 1.9 M β
β 14 β net.Do_13 β Dropout β 0 β
β 15 β net.L_14 β TransposedSummarizingRNN β 963 K β
β 16 β net.Do_15 β Dropout β 0 β
β 17 β net.L_16 β TransposedSummarizingRNN β 963 K β
β 18 β net.Do_17 β Dropout β 0 β
β 19 β features β MultiParamSequential β 207 K β
β 20 β wav2vec2mask β Wav2Vec2Mask β 388 K β
β 21 β wav2vec2mask.mask_emb β Embedding β 3.8 K β
β 22 β wav2vec2mask.project_q β Linear β 384 K β
β 23 β encoder β MultiParamSequential β 3.8 M β
ββββββ΄βββββββββββββββββββββββββ΄βββββββββββββββββββββββββββ΄βββββββββ
Trainable params: 4.4 M
Non-trainable params: 0
Total params: 4.4 M
Total estimated model params size (MB): 17
Validation Sanity Check ββββββββββββββββββββββββββββββββββββββββ 0/66 -:--:-- 0:00:00
ketos train -d cuda:0 -f xml -i /home/stweil/.config/kraken/digitue_best.mlmodel -t list.shuf.train -o 202211261525/german_handwriting --resize add -r 0.0001
WARNING Text line "" is empty after transformations train.py:361
[...]
WARNING Text line "" is empty after transformations train.py:361
GPU available: True (cuda), used: True
TPU available: False, using: 0 TPU cores
IPU available: False, using: 0 IPUs
HPU available: False, using: 0 HPUs
`Trainer(val_check_interval=1.0)` was configured so validation will run at the end of the training epoch..
LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
ββββββ³ββββββββββββ³βββββββββββββββββββββββββββ³βββββββββ³βββββββββββββββββββββββββββ³βββββββββββββββββββββββββββ
β β Name β Type β Params β In sizes β Out sizes β
β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β 0 β net β MultiParamSequential β 4.1 M β [[1, 1, 120, 400], '?'] β [[1, 279, 1, 50], '?'] β
β 1 β net.C_0 β ActConv2D β 1.3 K β [[1, 1, 120, 400], '?'] β [[1, 32, 120, 400], '?'] β
β 2 β net.Do_1 β Dropout β 0 β [[1, 32, 120, 400], '?'] β [[1, 32, 120, 400], '?'] β
β 3 β net.Mp_2 β MaxPool β 0 β [[1, 32, 120, 400], '?'] β [[1, 32, 60, 200], '?'] β
β 4 β net.C_3 β ActConv2D β 40.0 K β [[1, 32, 60, 200], '?'] β [[1, 32, 60, 200], '?'] β
β 5 β net.Do_4 β Dropout β 0 β [[1, 32, 60, 200], '?'] β [[1, 32, 60, 200], '?'] β
β 6 β net.Mp_5 β MaxPool β 0 β [[1, 32, 60, 200], '?'] β [[1, 32, 30, 100], '?'] β
β 7 β net.C_6 β ActConv2D β 55.4 K β [[1, 32, 30, 100], '?'] β [[1, 64, 30, 100], '?'] β
β 8 β net.Do_7 β Dropout β 0 β [[1, 64, 30, 100], '?'] β [[1, 64, 30, 100], '?'] β
β 9 β net.Mp_8 β MaxPool β 0 β [[1, 64, 30, 100], '?'] β [[1, 64, 15, 50], '?'] β
β 10 β net.C_9 β ActConv2D β 110 K β [[1, 64, 15, 50], '?'] β [[1, 64, 15, 50], '?'] β
β 11 β net.Do_10 β Dropout β 0 β [[1, 64, 15, 50], '?'] β [[1, 64, 15, 50], '?'] β
β 12 β net.S_11 β Reshape β 0 β [[1, 64, 15, 50], '?'] β [[1, 960, 1, 50], '?'] β
β 13 β net.L_12 β TransposedSummarizingRNN β 1.9 M β [[1, 960, 1, 50], '?'] β [[1, 400, 1, 50], '?'] β
β 14 β net.Do_13 β Dropout β 0 β [[1, 400, 1, 50], '?'] β [[1, 400, 1, 50], '?'] β
β 15 β net.L_14 β TransposedSummarizingRNN β 963 K β [[1, 400, 1, 50], '?'] β [[1, 400, 1, 50], '?'] β
β 16 β net.Do_15 β Dropout β 0 β [[1, 400, 1, 50], '?'] β [[1, 400, 1, 50], '?'] β
β 17 β net.L_16 β TransposedSummarizingRNN β 963 K β [[1, 400, 1, 50], '?'] β [[1, 400, 1, 50], '?'] β
β 18 β net.Do_17 β Dropout β 0 β [[1, 400, 1, 50], '?'] β [[1, 400, 1, 50], '?'] β
β 19 β net.O_18 β LinSoftmax β 111 K β [[1, 400, 1, 50], '?'] β [[1, 279, 1, 50], '?'] β
ββββββ΄ββββββββββββ΄βββββββββββββββββββββββββββ΄βββββββββ΄βββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββ
Trainable params: 4.1 M
Non-trainable params: 0
Total params: 4.1 M
Total estimated model params size (MB): 16
stage 0/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:30:54 val_accuracy: 0.67250 early_stopping: 0/5 0.67250
stage 1/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:30:29 val_accuracy: 0.77690 early_stopping: 0/5 0.77690
stage 2/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:30:37 val_accuracy: 0.82208 early_stopping: 0/5 0.82208
stage 3/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:31:23 val_accuracy: 0.84496 early_stopping: 0/5 0.84496
stage 4/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:32:29 val_accuracy: 0.86469 early_stopping: 0/5 0.86469
stage 5/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:31:10 val_accuracy: 0.87568 early_stopping: 0/5 0.87568
stage 6/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:31:30 val_accuracy: 0.88534 early_stopping: 0/5 0.88534
stage 7/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:31:01 val_accuracy: 0.89373 early_stopping: 0/5 0.89373
stage 8/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:30:58 val_accuracy: 0.89676 early_stopping: 0/5 0.89676
stage 9/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:27:53 val_accuracy: 0.90261 early_stopping: 0/5 0.90261
stage 10/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:24:14 val_accuracy: 0.90775 early_stopping: 0/5 0.90775
stage 11/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:24:10 val_accuracy: 0.90983 early_stopping: 0/5 0.90983
stage 12/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:23:22 val_accuracy: 0.91347 early_stopping: 0/5 0.91347
stage 13/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:23:57 val_accuracy: 0.91408 early_stopping: 0/5 0.91408
stage 14/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:24:11 val_accuracy: 0.91815 early_stopping: 0/5 0.91815
stage 15/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:22:18 val_accuracy: 0.91959 early_stopping: 0/5 0.91959
stage 16/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:23:47 val_accuracy: 0.92043 early_stopping: 0/5 0.92043
stage 17/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:24:28 val_accuracy: 0.92369 early_stopping: 0/5 0.92369
stage 18/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:23:58 val_accuracy: 0.92322 early_stopping: 1/5 0.92369
stage 19/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:21:10 val_accuracy: 0.92586 early_stopping: 0/5 0.92586
stage 20/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:24:12 val_accuracy: 0.76328 early_stopping: 1/5 0.92586
stage 21/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:23:32 val_accuracy: 0.92818 early_stopping: 0/5 0.92818
stage 22/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:24:05 val_accuracy: 0.92855 early_stopping: 0/5 0.92855
stage 23/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:23:57 val_accuracy: 0.92989 early_stopping: 0/5 0.92989
stage 24/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:24:08 val_accuracy: 0.93016 early_stopping: 0/5 0.93016
stage 25/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:24:04 val_accuracy: 0.93197 early_stopping: 0/5 0.93197
stage 26/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:22:27 val_accuracy: 0.93215 early_stopping: 0/5 0.93215
stage 27/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:23:59 val_accuracy: 0.93361 early_stopping: 0/5 0.93361
stage 28/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:20:37 val_accuracy: 0.93408 early_stopping: 0/5 0.93408
stage 29/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:23:35 val_accuracy: 0.93470 early_stopping: 0/5 0.93470
stage 30/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:24:24 val_accuracy: 0.93382 early_stopping: 1/5 0.93470
stage 31/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:22:34 val_accuracy: 0.93630 early_stopping: 0/5 0.93630
stage 32/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:24:10 val_accuracy: 0.92988 early_stopping: 1/5 0.93630
stage 33/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:23:50 val_accuracy: 0.93543 early_stopping: 2/5 0.93630
stage 34/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:24:06 val_accuracy: 0.81099 early_stopping: 3/5 0.93630
stage 35/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:22:24 val_accuracy: 0.93757 early_stopping: 0/5 0.93757
stage 36/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:32:17 val_accuracy: 0.93726 early_stopping: 1/5 0.93757
stage 37/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:23:43 val_accuracy: 0.93821 early_stopping: 0/5 0.93821
stage 38/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:24:05 val_accuracy: 0.93877 early_stopping: 0/5 0.93877
stage 39/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:22:21 val_accuracy: 0.93811 early_stopping: 1/5 0.93877
stage 40/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:23:15 val_accuracy: 0.93799 early_stopping: 2/5 0.93877
stage 41/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 5:54:09 val_accuracy: 0.93705 early_stopping: 3/5 0.93877
stage 42/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:23:33 val_accuracy: 0.93911 early_stopping: 0/5 0.93911
stage 43/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 5:54:42 val_accuracy: 0.93913 early_stopping: 0/5 0.93913
stage 44/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 4:15:59 val_accuracy: 0.93914 early_stopping: 0/5 0.93914
stage 45/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 7:06:10 val_accuracy: 0.94090 early_stopping: 0/5 0.94090
stage 46/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 7:35:41 val_accuracy: 0.93956 early_stopping: 1/5 0.94090
stage 47/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 4:49:43 val_accuracy: 0.94088 early_stopping: 2/5 0.94090
stage 48/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 3:21:49 val_accuracy: 0.94045 early_stopping: 3/5 0.94090
stage 49/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 4:40:36 val_accuracy: 0.94002 early_stopping: 4/5 0.94090
stage 50/β ββββββββββββββββββββββββββββββββββββββββ 33797/33797 0:00:00 7:16:09 val_accuracy: 0.93965 early_stopping: 5/5 0.94090
Moving best model 202211261525/german_handwriting_45.mlmodel (0.940900444984436) to 202211261525/german_handwriting_best.mlmodel
real 11685m35,360s
user 20753m55,042s
sys 27866m56,116s