Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lstm.py RuntimeWarning: overflow encountered #246

Closed
rnsrk opened this issue Sep 22, 2017 · 3 comments
Closed

lstm.py RuntimeWarning: overflow encountered #246

rnsrk opened this issue Sep 22, 2017 · 3 comments

Comments

@rnsrk
Copy link

rnsrk commented Sep 22, 2017

While using ocropus.rpred, the error /usr/local/lib/python2.7/dist-packages/ocrolib/lstm.py:383: RuntimeWarning: overflow encountered in exp return 1.0/(1.0+exp(-x)) appears.

Current Behavior

Errors appears while error computing process described in #243
The lines are recognised and saved as expected, but randomly the error above occurs, looks like:

INFO: training/zedler_0013_01002c.bin.png:9. Bernardinus gidius Recchi, An. 1711.
INFO: training/zedler_0013_01002e.bin.png:Aquapendente (Hieronjmus Fabricius ab) siehe
INFO: training/zedler_0013_010030.bin.png:Aquapendente (Micolaut ab) ein Jtaliäner, aus
/usr/local/lib/python2.7/dist-packages/ocrolib/lstm.py:383: RuntimeWarning: overflow encountered in exp
return 1.0/(1.0+exp(-x))
INFO: training/zedler_0013_010031.bin.png:dem Orden S. Augustini, schrieb de Raptiso: a Pec-
INFO: training/zedler_0013_010032.bin.png:e o trigiu ali: de Pr tenti : de s, infero,
/usr/local/lib/python2.7/dist-packages/ocrolib/lstm.py:383: RuntimeWarning: overflow encountered in exp
return 1.0/(1.0+exp(-x))
INFO: training/zedler_0013_010035.bin.png:pie auh Conciones siue Serones. Hemdreich.
INFO: training/zedler_0013_010034.bin.png:mgratitudine: de Festis Sasktorum: Kuadragesiuale
INFO: training/zedler_0013_010033.bin.png:prg atorio: de Merc atura: de ortilegss: de vitamncka
INFO: training/zedler_0013_010036.bin.png:Aquapu lco, Lat. Portus aquæ pulchræ, eine

Your Environment

  • Python version: Python 2.7.13
  • Git revision of ocropy:
    downloaded 01.01.2017
  • Operating System and version:
    Ubuntu 17.04 x64
@zuphilip
Copy link
Collaborator

We have seen similar errors before and I think #201 will fix this. You can test these changes locally.

@rnsrk
Copy link
Author

rnsrk commented Sep 22, 2017

66c6007 worked fine, no runtime warnings anymore

@kba
Copy link
Collaborator

kba commented Sep 29, 2017

Fix was merged in #201

@kba kba closed this as completed Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants