question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError: zero-size array to reduction operation maximum which has no identity

See original GitHub issue

Hello! During the recognition process the following error is thrown and the recognition effectively stops proceeding, while the Status still reads “Status: ERROR: The process is still running” (OCR4all ver 0.3.0, LAREX ver 0.3.1):

Process ForkProcess-3:
Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.6/dist-packages/calamari_ocr-1.0.5-py3.6.egg/calamari_ocr/ocr/datasets/input_dataset.py", line 99, in run
    out = self.apply_single(*data)
  File "/usr/local/lib/python3.6/dist-packages/calamari_ocr-1.0.5-py3.6.egg/calamari_ocr/ocr/datasets/input_dataset.py", line 119, in apply_single
    line, params = self.params.data_processor.apply([line], 1, False)[0]
  File "/usr/local/lib/python3.6/dist-packages/calamari_ocr-1.0.5-py3.6.egg/calamari_ocr/ocr/data_processing/data_preprocessor.py", line 19, in apply
    processes=processes, progress_bar=progress_bar, max_tasks_per_child=max_tasks_per_child)
  File "/usr/local/lib/python3.6/dist-packages/calamari_ocr-1.0.5-py3.6.egg/calamari_ocr/utils/multiprocessing.py", line 32, in parallel_map
    out = list(map(f, d))
  File "/usr/local/lib/python3.6/dist-packages/calamari_ocr-1.0.5-py3.6.egg/calamari_ocr/ocr/data_processing/data_preprocessor.py", line 50, in _apply_single
    data, params = proc._apply_single(data)
  File "/usr/local/lib/python3.6/dist-packages/calamari_ocr-1.0.5-py3.6.egg/calamari_ocr/ocr/data_processing/data_preprocessor.py", line 50, in _apply_single
    data, params = proc._apply_single(data)
  File "/usr/local/lib/python3.6/dist-packages/calamari_ocr-1.0.5-py3.6.egg/calamari_ocr/ocr/data_processing/center_normalizer.py", line 15, in _apply_single
    out, params = self.normalize(data, cval=np.amax(data))
  File "<__array_function__ internals>", line 6, in amax
  File "/usr/local/lib/python3.6/dist-packages/numpy/core/fromnumeric.py", line 2668, in amax
    keepdims=keepdims, initial=initial, where=where)
  File "/usr/local/lib/python3.6/dist-packages/numpy/core/fromnumeric.py", line 90, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation maximum which has no identity

I have attached the PAGEXML and image files where the error occurs. I couldn’t find anything suspicious here.

0125 nrm 0125 bin 0125.txt

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alexander-winklercommented, Jun 24, 2020

I hope this helps …

0125.zip

0reactions
maxnthcommented, Jun 24, 2020

Thank you for the files. I sadly couldn’t reproduce the broken coordinates when converting to latest with the supplied legacy files but we’ll keep looking into this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Overcome ValueError for empty array - python - Stack Overflow
ValueError: zero-size array to reduction operation minimum which has no identity. because the array is empty. How to work around it, ...
Read more >
zero-size array to reduction operation minimum which has no ...
value error when I use set_data() on a mrc file Traceback (most recent call last): File "test_crop_img.py", line 31, ...
Read more >
Valueerror: zero-size array to reduction ... - CodeProject
ValueError : zero-size array to reduction operation maximum which has no identity <pre> The message implies that <code>y_train</code> does not ...
Read more >
zero-size array to reduction operation minimum which has no ...
It's because of your cropped image. it is an empty array or has an empty dimention. Take a look at the shapes of...
Read more >
Zero-size array to reduction operation maximum which has no ...
Hello @Hrishikesh. pawar , You have only one data sample with a total length of 0s.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found