githubharald / SimpleHTR

Handwritten Text Recognition (HTR) system implemented with TensorFlow.
https://towardsdatascience.com/2326a3487cd5
MIT License
1.99k stars 894 forks source link

ZeroDivisionError, on own dataset #77

Closed akshayy29 closed 5 years ago

akshayy29 commented 5 years ago
  1. Versions

    • TensorFlow version = 1.12.0
    • Python version = Tried on 2.7 as well as 3.6
    • Fedora 30
  2. Issue I got a ZeroDivision error, checked the last issue with the same error, still not able to solve it. Posting my words.txt & error below.

ERROR:

Epoch: 1
Train NN
Batch: 1 / 1 Loss: 97.86624
Validate NN
Traceback (most recent call last):
  File "main.py", line 145, in <module>
    main()
  File "main.py", line 132, in main
    train(model, loader)
  File "main.py", line 42, in train
    charErrorRate = validate(model, loader)
  File "main.py", line 85, in validate
    charErrorRate = numCharErr / numCharTotal
ZeroDivisionError: division by zero

Words.txt

sub-sub-0 X X X X X X X HIGH
sub-sub-1 X X X X X X X RAISED
sub-sub-2 X X X X X X X PERFORMANCE
sub-sub-3 X X X X X X X FINE
sub-sub-4 X X X X X X X MILTON
sub-sub-5 X X X X X X X HUMIDITY
sub-sub-6 X X X X X X X CONDENSATE
...
sub-sub-100 X X X X X X X someword
githubharald commented 5 years ago

You need more data. Using the current train/validation split at 95% and batch size 50, you need at least 1000 samples. See this issue for more details: https://github.com/githubharald/SimpleHTR/issues/11