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

[Docker] anybaseocr wants Tensorflow 2.0 #116

Closed
M3ssman opened this issue Jun 19, 2020 · 2 comments
Closed

[Docker] anybaseocr wants Tensorflow 2.0 #116

M3ssman opened this issue Jun 19, 2020 · 2 comments

Comments

@M3ssman
Copy link
Contributor

M3ssman commented Jun 19, 2020

Distribution

"Id": "sha256:00ceb6e2c3cd28b7d79d779be5020f1df82966d793f9a92d5768d5abaa005310",
"RepoTags": [
    "ocrd/all:maximum"
],
"RepoDigests": ["ocrd/all@sha256:47c02733c490ff34640b44713a887c731eae07d4ec69107d3cd99031247a1d26"
],
"Created": "2020-06-18T13:45:21.648347181Z",

Plattform

Ubuntu 18.04 LTS

Log

building OCR-D-SEG-PAGE-anyocr from OCR-D-BINPAGE-sauvola with pattern rule for ocrd-anybaseocr-crop
STAMP=`test -e OCR-D-SEG-PAGE-anyocr && date -Ins -r OCR-D-SEG-PAGE-anyocr`; ocrd-anybaseocr-crop   -I OCR-D-BINPAGE-sauvola -p OCR-D-SEG-PAGE-anyocr.json -O OCR-D-SEG-PAGE-anyocr --overwrite 2>&1 | tee OCR-D-SEG-PAGE-anyocr.log && touch -c OCR-D-SEG-PAGE-anyocr || { if test -z "$STAMP"; then rm -fr OCR-D-SEG-PAGE-anyocr; else touch -c -d "$STAMP" OCR-D-SEG-PAGE-anyocr; fi; false; }
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 791, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (tensorflow 1.15.3 (/usr/lib/python3.6/site-packages), Requirement.parse('tensorflow>=2.0'), {'ocrd-anybaseocr'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/ocrd-anybaseocr-crop", line 33, in <module>
    sys.exit(load_entry_point('ocrd-anybaseocr', 'console_scripts', 'ocrd-anybaseocr-crop')())
  File "/usr/bin/ocrd-anybaseocr-crop", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.6/site-packages/importlib_metadata/__init__.py", line 96, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/build/ocrd_anybaseocr/ocrd_anybaseocr/cli/cli.py", line 3, in <module>
    from ocrd.decorators import ocrd_cli_options, ocrd_cli_wrap_processor
  File "/build/core/ocrd/ocrd/__init__.py", line 17, in <module>
    from ocrd.processor.base import run_processor, run_cli, Processor
  File "/build/core/ocrd/ocrd/processor/__init__.py", line 1, in <module>
    from .base import (
  File "/build/core/ocrd/ocrd/processor/base.py", line 6, in <module>
    from ocrd_utils import getLogger, VERSION as OCRD_VERSION
  File "/build/core/ocrd_utils/ocrd_utils/__init__.py", line 135, in <module>
    from .logging import * # pylint: disable=wildcard-import
  File "/build/core/ocrd_utils/ocrd_utils/logging.py", line 22, in <module>
    from .constants import LOG_FORMAT, LOG_TIMEFMT
  File "/build/core/ocrd_utils/ocrd_utils/constants.py", line 4, in <module>
    from pkg_resources import get_distribution
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3260, in <module>
    @_call_aside
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3244, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3273, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 585, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'tensorflow>=2.0' distribution was not found and is required by ocrd-anybaseocr
Makefile:313: recipe for target 'OCR-D-SEG-PAGE-anyocr' failed
make[1]: *** [OCR-D-SEG-PAGE-anyocr] Error 1
make[1]: Leaving directory '/data/1000'
make: *** [1000] Error 2
Makefile:204: recipe for target '1000' failed
make: Leaving directory '/data'

real	1m36,408s

@bertsky
Copy link
Collaborator

bertsky commented Jun 19, 2020

I am surprised to see this come up again. And I cannot reproduce:

docker run -it ocrd/all@sha256:47c02733c490ff34640b44713a887c731eae07d4ec69107d3cd99031247a1d26
root@32bc9163590c:/data# pip show tensorflow
Name: tensorflow
Version: 2.0.2
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: [email protected]
License: Apache 2.0
Location: /usr/lib/python3.6/site-packages
Requires: absl-py, protobuf, keras-applications, astor, grpcio, wheel, six, tensorboard, gast, keras-preprocessing, opt-einsum, termcolor, google-pasta, wrapt, numpy, tensorflow-estimator
Required-by: ocrd-anybaseocr
root@32bc9163590c:/data# pip show tensorflow-gpu
Name: tensorflow-gpu
Version: 1.15.3
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: [email protected]
License: Apache 2.0
Location: /usr/lib/python3.6/site-packages
Requires: google-pasta, absl-py, six, grpcio, tensorboard, tensorflow-estimator, numpy, termcolor, wrapt, keras-applications, keras-preprocessing, protobuf, wheel, astor, gast, opt-einsum
Required-by: qurator-sbb-textline, ocrd-keraslm, ocrd-cor-asv-ann, ocrd-calamari
root@32bc9163590c:/data# ocrd-anybaseocr-crop -h
2020-06-19 20:24:33,180.180 INFO matplotlib.font_manager - generated new fontManager
Using TensorFlow backend.
2020-06-19 20:24:39,969.969 WARNING tensorflow - From /usr/lib/python3.6/site-packages/tensorflow_core/python/compat/v2_compat.py:65: 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

Usage: ocrd-anybaseocr-crop [OPTIONS]

  Crops the input image to the page frame using non-linear processing and outputs a border polygon

Are you quite sure the version you ran is the same that created above output?

@M3ssman
Copy link
Contributor Author

M3ssman commented Jun 20, 2020

@bertsky
You're right! I must admit the output above resulted from a run based on the recent version of ocrd/all:maximum-git. This was the base I used to pull in changes from other issues.
By now I checked the brand new Image two times and it runs quite fine.

@M3ssman M3ssman closed this as completed Jun 20, 2020
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

2 participants