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

block-segmentation: #68

Open
jbarth-ubhd opened this issue Aug 28, 2020 · 0 comments
Open

block-segmentation: #68

jbarth-ubhd opened this issue Aug 28, 2020 · 0 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@jbarth-ubhd
Copy link

jbarth-ubhd commented Aug 28, 2020

I'll get ValueError: tile cannot extend outside image

Images (850 MB): https://digi.ub.uni-heidelberg.de/diglitData/v/testset-5-zeitschr-ca-1870.zip

  File "/dwork/ocrd-schroot-ubuntu-eoan/usr/local/ocrd_all/venv/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/dwork/ocrd-schroot-ubuntu-eoan/usr/local/ocrd_all/venv/lib/python3.6/site-packages/ocrd/cli/process.py", line 27, in process_cli
    run_tasks(mets, log_level, page_id, tasks, overwrite)
  File "/dwork/ocrd-schroot-ubuntu-eoan/usr/local/ocrd_all/venv/lib/python3.6/site-packages/ocrd/task_sequence.py", line 153, in run_tasks
    raise Exception("%s exited with non-zero return value %s. STDOUT:\n%s\nSTDERR:\n%s" % (task.executable, returncode, out, err))
Exception: ocrd-anybaseocr-block-segmentation exited with non-zero return value 1. STDOUT:
b'Processing 1 images\nimage                    shape: (3497, 2481, 3)       min:    0.00000  max:  255.00000  uint8\nmolded_images            shape: (1, 1024, 1024, 3)    min: -123.70000  max:  134.10000  float64\nimage_metas              shape: (1, 27)               min:    0.00000  max: 3497.00000  float64\nanchors                  shape: (1, 261888, 4)        min:   -0.35390  max:    1.29134  float32\n'
STDERR:
2020-08-28 12:54:45.245448: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer.so.6'; dlerror: libnvinfer.so.6: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/lib:
2020-08-28 12:54:45.246576: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer_plugin.so.6'; dlerror: libnvinfer_plugin.so.6: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/lib:
2020-08-28 12:54:45.246640: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:30] Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
12:55:05.253 WARNING tensorflow - From /dwork/ocrd-schroot-ubuntu-eoan/usr/local/ocrd_all/venv/local/sub-venv/headless-tf22/lib/python3.6/site-packages/tensorflow_core/python/compat/v2_compat.py:96: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
Instructions for updating:
non-resource variables are not supported in the long term
Using TensorFlow backend.
12:55:10.732 WARNING OcrdAnybaseocrBlockSegmenter - Tensorflow cannot detect CUDA installation. Running without GPU will be slow.
12:55:28.139 INFO ocrd.workspace - created file ID: OCR-D-N6_00001_0, file_grp: OCR-D-N6, path: OCR-D-N6/OCR-D-N6_00001_0.png
12:55:28.719 INFO ocrd.workspace - created file ID: OCR-D-N6_00001_1, file_grp: OCR-D-N6, path: OCR-D-N6/OCR-D-N6_00001_1.png
12:55:28.731 INFO ocrd.workspace - created file ID: OCR-D-N6_00001_2, file_grp: OCR-D-N6, path: OCR-D-N6/OCR-D-N6_00001_2.png
12:55:29.562 INFO ocrd.workspace - created file ID: OCR-D-N6_00001_3, file_grp: OCR-D-N6, path: OCR-D-N6/OCR-D-N6_00001_3.png
Traceback (most recent call last):
  File "/dwork/ocrd-schroot-ubuntu-eoan/usr/local/ocrd_all/venv/local/sub-venv/headless-tf22/bin/ocrd-anybaseocr-block-segmentation", line 8, in <module>
    sys.exit(cli())
  File "/dwork/ocrd-schroot-ubuntu-eoan/usr/local/ocrd_all/venv/local/sub-venv/headless-tf22/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/dwork/ocrd-schroot-ubuntu-eoan/usr/local/ocrd_all/venv/local/sub-venv/headless-tf22/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/dwork/ocrd-schroot-ubuntu-eoan/usr/local/ocrd_all/venv/local/sub-venv/headless-tf22/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/dwork/ocrd-schroot-ubuntu-eoan/usr/local/ocrd_all/venv/local/sub-venv/headless-tf22/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/dwork/ocrd-schroot-ubuntu-eoan/usr/local/ocrd_all/venv/local/sub-venv/headless-tf22/lib/python3.6/site-packages/ocrd_anybaseocr/cli/ocrd_anybaseocr_block_segmentation.py", line 391, in cli
    return ocrd_cli_wrap_processor(OcrdAnybaseocrBlockSegmenter, *args, **kwargs)
  File "/dwork/ocrd-schroot-ubuntu-eoan/usr/local/ocrd_all/venv/local/sub-venv/headless-tf22/lib/python3.6/site-packages/ocrd/decorators.py", line 102, in ocrd_cli_wrap_processor
    run_processor(processorClass, ocrd_tool, mets, workspace=workspace, **kwargs)
  File "/dwork/ocrd-schroot-ubuntu-eoan/usr/local/ocrd_all/venv/local/sub-venv/headless-tf22/lib/python3.6/site-packages/ocrd/processor/helpers.py", line 69, in run_processor
    processor.process()
  File "/dwork/ocrd-schroot-ubuntu-eoan/usr/local/ocrd_all/venv/local/sub-venv/headless-tf22/lib/python3.6/site-packages/ocrd_anybaseocr/cli/ocrd_anybaseocr_block_segmentation.py", line 124, in process
    self._process_segment(page_image, page, page_xywh, page_id, input_file, n, mrcnn_model, class_names, mask_image)
  File "/dwork/ocrd-schroot-ubuntu-eoan/usr/local/ocrd_all/venv/local/sub-venv/headless-tf22/lib/python3.6/site-packages/ocrd_anybaseocr/cli/ocrd_anybaseocr_block_segmentation.py", line 349, in _process_segment
    region_img = ocrolib.array2pil(region_img)
  File "/dwork/ocrd-schroot-ubuntu-eoan/usr/local/ocrd_all/venv/local/sub-venv/headless-tf22/lib/python3.6/site-packages/ocrolib/common.py", line 144, in array2pil
    return PIL.Image.frombytes("RGB",(a.shape[1],a.shape[0]),a.tostring())
  File "/dwork/ocrd-schroot-ubuntu-eoan/usr/local/ocrd_all/venv/local/sub-venv/headless-tf22/lib/python3.6/site-packages/PIL/Image.py", line 2650, in frombytes
    im.frombytes(data, decoder_name, args)
  File "/dwork/ocrd-schroot-ubuntu-eoan/usr/local/ocrd_all/venv/local/sub-venv/headless-tf22/lib/python3.6/site-packages/PIL/Image.py", line 797, in frombytes
    d.setimage(self.im)
ValueError: tile cannot extend outside image


Command exited with non-zero status 1

workflow:

. /usr/local/ocrd_all/venv/bin/activate
export TMPDIR=/dwork/tmp
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
ocrd-create-mets.xml
( /usr/bin/time ocrd process \
"olena-binarize -I OCR-D-IMG -O OCR-D-N1 -P impl wolf" \
"anybaseocr-crop -I OCR-D-N1 -O OCR-D-N2" \
"olena-binarize -I OCR-D-N2 -O OCR-D-N3 -P impl wolf" \
"cis-ocropy-denoise -I OCR-D-N3 -O OCR-D-N4 -P level-of-operation page" \
"cis-ocropy-deskew -I OCR-D-N4 -O OCR-D-N5 -P level-of-operation page" \
"anybaseocr-block-segmentation -I OCR-D-N5 -O OCR-D-N6 -P block_segmentation_weights /usr/local/ocrd_models/anybaseocr/block-segmentation/block_segmentation_weights.h5" \
"cis-ocropy-deskew -I OCR-D-N6 -O OCR-D-N7 -P level-of-operation region" \
"cis-ocropy-clip -I OCR-D-N7 -O OCR-D-N8 -P level-of-operation region" \
"cis-ocropy-segment -I OCR-D-N8 -O OCR-D-N9 -P level-of-operation region" \
"segment-repair -I OCR-D-N9 -O OCR-D-N10 -P sanitize true" \
"cis-ocropy-dewarp -I OCR-D-N10 -O OCR-D-N11" \
"calamari-recognize -I OCR-D-N11 -O OCR-D-OCR -P checkpoint /usr/local/ocrd_models/calamari/calamari_models-0.3/fraktur_19th_century/*.ckpt.json"

) >cmd.log 2>&1
@kba kba added the bug Something isn't working label Aug 28, 2020
@paulpestov paulpestov added the wontfix This will not be worked on label Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants