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

threshold must be numeric and non-NAN, try sys.maxsize for untruncated representation #5

Closed
CognitiveClouds-Prasad opened this issue Feb 7, 2019 · 4 comments

Comments

@CognitiveClouds-Prasad
Copy link

python document-image-binarization/binarize.py -imgpath x.jpg -modelpath MODELS/model_weights_dibco_6_256x256_s96_aug_m205_f64_k5_s2_se3_e200_b32_esp.h5 -w 256 -s 96 -f 64 -k 5 -stride 2 -th 0.5 --demo
Using TensorFlow backend.
Traceback (most recent call last):
File "document-image-binarization/binarize.py", line 12, in
util.init()
File "/home/x/x/x/document-image-binarization/util.py", line 14, in init
np.set_printoptions(threshold=np.nan)
File "/home/x/.local/lib/python2.7/site-packages/numpy/core/arrayprint.py", line 246, in set_printoptions
floatmode, legacy)
File "/home/x/.local/lib/python2.7/site-packages/numpy/core/arrayprint.py", line 93, in _make_options_dict
raise ValueError("threshold must be numeric and non-NAN, try "
ValueError: threshold must be numeric and non-NAN, try sys.maxsize for untruncated representation

I have been unable to run this application.

@VisualFox
Copy link
Contributor

@line 14 in util.py replace:
np.set_printoptions(threshold=np.nan)
by
np.set_printoptions(threshold=sys.maxsize)

I am going to work on a patch

and finally If you are running with python3 you also need to replace xrange by range in utilModelREDNet.py and utilDataGenerator.py

VisualFox added a commit to VisualFox/document-image-binarization that referenced this issue Feb 18, 2019
ajgallego added a commit that referenced this issue Feb 18, 2019
Fixing threshold must be numeric and non-NAN issue #5
@ajgallego
Copy link
Owner

Thanks @VisualFox, I close this issue since it has been fixed by @VisualFox.

@CognitiveClouds-Prasad
Copy link
Author

Thanks @VisualFox 🙂 I will try it out today or in sometime. I will reply back on this thread if there are issues.

@CognitiveClouds-Prasad
Copy link
Author

This is working beautifully! Thanks @ajgallego and @VisualFox 🙂

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