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

ocropus-rpred estrate option throws exceptions #121

Closed
wallclock opened this issue Oct 18, 2016 · 6 comments
Closed

ocropus-rpred estrate option throws exceptions #121

wallclock opened this issue Oct 18, 2016 · 6 comments
Labels

Comments

@wallclock
Copy link

Got the following exception when estrate is used.

Without my-line.gt.txt:

$ ocropus-rpred --estrate -m en-default.pyrnn.gz my-line.png 
INFO:  
INFO:  ########## /usr/local/bin/ocropus-rpred --estrate -m en-default.pyrnn.g
INFO:  
INFO:  #inputs1
# loading object en-default.pyrnn.gz
Traceback (most recent call last):
  File "/usr/local/bin/ocropus-rpred", line 289, in <module>
    print_info("%.5f"%(terr*1.0/total) + " " + terr+ " " + total + " " + args.model)
ZeroDivisionError: float division by zero

With my-line.gt.txt:

$ ocropus-rpred --estrate -m en-default.pyrnn.gz my-line.png 
INFO:  
INFO:  ########## /usr/local/bin/ocropus-rpred --estrate -m en-default.pyrnn.g
INFO:  
INFO:  #inputs1
# loading object en-default.pyrnn.gz
INFO:    6   6 my-line.png:I 5 $ 4 d L
Traceback (most recent call last):
  File "/usr/local/bin/ocropus-rpred", line 289, in <module>
    print_info("%.5f"%(terr*1.0/total) + " " + terr+ " " + total + " " + args.model)
TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('S32') dtype('S32') dtype('S32')
$ python --version
Python 2.7.12
@zuphilip
Copy link
Collaborator

This looks like a bug, also my error message looks a little different. Can you provide as your example (bin.png and gt.txt file)? What version of numpy are you using? You can find out by the following python commands:

import numpy
numpy.version.version

@wallclock
Copy link
Author

Here you go:
output
output.gt.txt

>>> import numpy
>>> numpy.version.version
'1.11.2'

Had the same issue with numpy 1.11.0 provided by ubuntu.

@zuphilip
Copy link
Collaborator

This issue will probably be solved by #124.

@zuphilip
Copy link
Collaborator

Okay, that PR is now merged and it should solve this issue. @wallclock You can update to the newest version and test it again. Can you confirm that it is now working?

@wallclock
Copy link
Author

Yes it is now working, thanks!

@tmbdev
Copy link
Collaborator

tmbdev commented Oct 31, 2016

Note that the default model is not trained at all for handwriting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants