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

ocrd_all native installation fails due to tensorflow #235

Closed
sven-nm opened this issue Jan 25, 2021 · 20 comments · Fixed by #289
Closed

ocrd_all native installation fails due to tensorflow #235

sven-nm opened this issue Jan 25, 2021 · 20 comments · Fixed by #289
Labels
bug Something isn't working

Comments

@sven-nm
Copy link

sven-nm commented Jan 25, 2021

Like #219, when installing ocrd_all natively on ubuntu 20.04 and python 3.8.5, make all fails and returns the following error (full stacktrace below):

ERROR: Could not find a version that satisfies the requirement tensorflow-gpu==1.15.* (from ocrd-cor-asv-ann)
ERROR: No matching distribution found for tensorflow-gpu==1.15.*

full log :

user@base:~/ocrd_all$ make all
sem --will-cite --fg --id ocrd_all_git git submodule sync  cor-asv-ann
Synchronizing submodule url for 'cor-asv-ann'
if git submodule status  cor-asv-ann | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   cor-asv-ann && \
	touch cor-asv-ann; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  core
Synchronizing submodule url for 'core'
if git submodule status  core | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   core && \
	touch core; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  dinglehopper
Synchronizing submodule url for 'dinglehopper'
if git submodule status  dinglehopper | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   dinglehopper && \
	touch dinglehopper; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  format-converters
Synchronizing submodule url for 'format-converters'
if git submodule status  format-converters | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   format-converters && \
	touch format-converters; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  ocrd_anybaseocr
Synchronizing submodule url for 'ocrd_anybaseocr'
if git submodule status  ocrd_anybaseocr | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   ocrd_anybaseocr && \
	touch ocrd_anybaseocr; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  ocrd_calamari
Synchronizing submodule url for 'ocrd_calamari'
if git submodule status  ocrd_calamari | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   ocrd_calamari && \
	touch ocrd_calamari; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  ocrd_cis
Synchronizing submodule url for 'ocrd_cis'
if git submodule status  ocrd_cis | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   ocrd_cis && \
	touch ocrd_cis; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync --recursive ocrd_fileformat
Synchronizing submodule url for 'ocrd_fileformat'
Synchronizing submodule url for 'ocrd_fileformat/repo/assets'
Synchronizing submodule url for 'ocrd_fileformat/repo/ocr-fileformat'
if git submodule status --recursive ocrd_fileformat | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init --recursive  ocrd_fileformat && \
	touch ocrd_fileformat; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  ocrd_im6convert
Synchronizing submodule url for 'ocrd_im6convert'
if git submodule status  ocrd_im6convert | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   ocrd_im6convert && \
	touch ocrd_im6convert; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  ocrd_keraslm
Synchronizing submodule url for 'ocrd_keraslm'
if git submodule status  ocrd_keraslm | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   ocrd_keraslm && \
	touch ocrd_keraslm; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  ocrd_olahd_client
Synchronizing submodule url for 'ocrd_olahd_client'
if git submodule status  ocrd_olahd_client | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   ocrd_olahd_client && \
	touch ocrd_olahd_client; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync --recursive ocrd_olena
Synchronizing submodule url for 'ocrd_olena'
Synchronizing submodule url for 'ocrd_olena/repo/assets'
Synchronizing submodule url for 'ocrd_olena/repo/olena'
if git submodule status --recursive ocrd_olena | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init --recursive  ocrd_olena && \
	touch ocrd_olena; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  ocrd_pagetopdf
Synchronizing submodule url for 'ocrd_pagetopdf'
if git submodule status  ocrd_pagetopdf | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   ocrd_pagetopdf && \
	touch ocrd_pagetopdf; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  ocrd_pc_segmentation
Synchronizing submodule url for 'ocrd_pc_segmentation'
if git submodule status  ocrd_pc_segmentation | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   ocrd_pc_segmentation && \
	touch ocrd_pc_segmentation; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  ocrd_repair_inconsistencies
Synchronizing submodule url for 'ocrd_repair_inconsistencies'
if git submodule status  ocrd_repair_inconsistencies | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   ocrd_repair_inconsistencies && \
	touch ocrd_repair_inconsistencies; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  ocrd_segment
Synchronizing submodule url for 'ocrd_segment'
if git submodule status  ocrd_segment | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   ocrd_segment && \
	touch ocrd_segment; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  ocrd_tesserocr
Synchronizing submodule url for 'ocrd_tesserocr'
if git submodule status  ocrd_tesserocr | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   ocrd_tesserocr && \
	touch ocrd_tesserocr; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  ocrd_typegroups_classifier
Synchronizing submodule url for 'ocrd_typegroups_classifier'
if git submodule status  ocrd_typegroups_classifier | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   ocrd_typegroups_classifier && \
	touch ocrd_typegroups_classifier; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  ocrd_wrap
Synchronizing submodule url for 'ocrd_wrap'
if git submodule status  ocrd_wrap | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   ocrd_wrap && \
	touch ocrd_wrap; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  sbb_binarization
Synchronizing submodule url for 'sbb_binarization'
if git submodule status  sbb_binarization | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   sbb_binarization && \
	touch sbb_binarization; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  sbb_textline_detector
Synchronizing submodule url for 'sbb_textline_detector'
if git submodule status  sbb_textline_detector | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   sbb_textline_detector && \
	touch sbb_textline_detector; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  tesseract
Synchronizing submodule url for 'tesseract'
if git submodule status  tesseract | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   tesseract && \
	touch tesseract; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  tesserocr
Synchronizing submodule url for 'tesserocr'
if git submodule status  tesserocr | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   tesserocr && \
	touch tesserocr; fi
sem --will-cite --fg --id ocrd_all_git git submodule sync  workflow-configuration
Synchronizing submodule url for 'workflow-configuration'
if git submodule status  workflow-configuration | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   workflow-configuration && \
	touch workflow-configuration; fi
make -B -o cor-asv-ann ocrd-cor-asv-ann-evaluate ocrd-cor-asv-ann-process cor-asv-ann-train cor-asv-ann-eval cor-asv-ann-repl VIRTUAL_ENV=/home/user/ocrd_all/venv/local/sub-venv/headless-tf1
make[1]: Entering directory '/home/user/ocrd_all'
sem --will-cite --fg --id ocrd_all_git python3 -m venv /home/user/ocrd_all/venv/local/sub-venv/headless-tf1
. /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/bin/activate && sem --will-cite --fg --id ocrd_all_git pip3 install --upgrade pip setuptools
Requirement already satisfied: pip in ./venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (20.3.3)
Requirement already satisfied: setuptools in ./venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (51.3.3)
Collecting pip
  Downloading pip-21.0-py3-none-any.whl (1.5 MB)
Collecting setuptools
  Downloading setuptools-52.0.0-py3-none-any.whl (784 kB)
Installing collected packages: setuptools, pip
  Attempting uninstall: setuptools
    Found existing installation: setuptools 51.3.3
    Uninstalling setuptools-51.3.3:
      Successfully uninstalled setuptools-51.3.3
  Attempting uninstall: pip
    Found existing installation: pip 20.3.3
    Uninstalling pip-20.3.3:
      Successfully uninstalled pip-20.3.3
Successfully installed pip-21.0 setuptools-52.0.0
. /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/bin/activate && pip3 install --force-reinstall  wheel
Collecting wheel
  Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel
  Attempting uninstall: wheel
    Found existing installation: wheel 0.36.2
    Uninstalling wheel-0.36.2:
      Successfully uninstalled wheel-0.36.2
Successfully installed wheel-0.36.2
sem --will-cite --fg --id ocrd_all_git git submodule sync  core
Synchronizing submodule url for 'core'
if git submodule status  core | grep -qv '^ '; then \
	sem --will-cite --fg --id ocrd_all_git git submodule update --init   core && \
	touch core; fi
. /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/bin/activate && make -C core install PIP_INSTALL="pip3 install "
make[2]: Entering directory '/home/user/ocrd_all/core'
pip install -U "pip>=19.0.0" wheel
Requirement already satisfied: pip>=19.0.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (21.0)
Collecting pip>=19.0.0
  Using cached pip-21.0-py3-none-any.whl (1.5 MB)
  Downloading pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 5.2 MB/s 
Requirement already satisfied: wheel in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (0.36.2)
Collecting wheel
  Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
  Downloading wheel-0.36.1-py2.py3-none-any.whl (34 kB)
for mod in ocrd_utils ocrd_models ocrd_modelfactory ocrd_validators ocrd;do (cd $mod ; pip3 install  .);done
Processing /home/user/ocrd_all/core/ocrd_utils
Requirement already satisfied: Pillow>=7.2.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-utils==2.21.0) (8.1.0)
Requirement already satisfied: numpy in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-utils==2.21.0) (1.19.5)
Requirement already satisfied: atomicwrites>=1.3.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-utils==2.21.0) (1.4.0)
Building wheels for collected packages: ocrd-utils
  Building wheel for ocrd-utils (setup.py) ... done
  Created wheel for ocrd-utils: filename=ocrd_utils-2.21.0-py3-none-any.whl size=17147 sha256=6e8a974adfa4ba9f6fe6f20deb7b613b4e5d4a4bdbd0ae64be97fe7ed6061591
  Stored in directory: /tmp/pip-ephem-wheel-cache-11ymgd5t/wheels/b0/0a/c6/89c5884bbfacb3290f84c84b8249f5641f2863ad1b3bfdedae
Successfully built ocrd-utils
Installing collected packages: ocrd-utils
  Attempting uninstall: ocrd-utils
    Found existing installation: ocrd-utils 2.21.0
    Uninstalling ocrd-utils-2.21.0:
      Successfully uninstalled ocrd-utils-2.21.0
Successfully installed ocrd-utils-2.21.0
Processing /home/user/ocrd_all/core/ocrd_models
Requirement already satisfied: lxml in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-models==2.21.0) (4.6.2)
Requirement already satisfied: ocrd_utils==2.21.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-models==2.21.0) (2.21.0)
Requirement already satisfied: Pillow>=7.2.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd_utils==2.21.0->ocrd-models==2.21.0) (8.1.0)
Requirement already satisfied: atomicwrites>=1.3.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd_utils==2.21.0->ocrd-models==2.21.0) (1.4.0)
Requirement already satisfied: numpy in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd_utils==2.21.0->ocrd-models==2.21.0) (1.19.5)
Building wheels for collected packages: ocrd-models
  Building wheel for ocrd-models (setup.py) ... done
  Created wheel for ocrd-models: filename=ocrd_models-2.21.0-py3-none-any.whl size=87958 sha256=d30000258b3ffbc93261554cd011e206a61373e9e66890186be1c13bce9a4ed3
  Stored in directory: /tmp/pip-ephem-wheel-cache-hfpm_hj2/wheels/1c/00/07/51a92d7320e63362463d9cd11a63d324ecf7887eadf9c512a7
Successfully built ocrd-models
Installing collected packages: ocrd-models
  Attempting uninstall: ocrd-models
    Found existing installation: ocrd-models 2.21.0
    Uninstalling ocrd-models-2.21.0:
      Successfully uninstalled ocrd-models-2.21.0
Successfully installed ocrd-models-2.21.0
Processing /home/user/ocrd_all/core/ocrd_modelfactory
Requirement already satisfied: lxml in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-modelfactory==2.21.0) (4.6.2)
Requirement already satisfied: ocrd_utils==2.21.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-modelfactory==2.21.0) (2.21.0)
Requirement already satisfied: ocrd_models==2.21.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-modelfactory==2.21.0) (2.21.0)
Requirement already satisfied: numpy in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd_utils==2.21.0->ocrd-modelfactory==2.21.0) (1.19.5)
Requirement already satisfied: Pillow>=7.2.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd_utils==2.21.0->ocrd-modelfactory==2.21.0) (8.1.0)
Requirement already satisfied: atomicwrites>=1.3.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd_utils==2.21.0->ocrd-modelfactory==2.21.0) (1.4.0)
Building wheels for collected packages: ocrd-modelfactory
  Building wheel for ocrd-modelfactory (setup.py) ... done
  Created wheel for ocrd-modelfactory: filename=ocrd_modelfactory-2.21.0-py3-none-any.whl size=2340 sha256=5440d4fd54fcb286adb14524a7de8ad27c9dc9d670e057353a73ad015e120132
  Stored in directory: /tmp/pip-ephem-wheel-cache-b_nu53ar/wheels/81/eb/bc/98b70d3493bc9ee6f5e63eee2f533202e135450d8b996fede1
Successfully built ocrd-modelfactory
Installing collected packages: ocrd-modelfactory
  Attempting uninstall: ocrd-modelfactory
    Found existing installation: ocrd-modelfactory 2.21.0
    Uninstalling ocrd-modelfactory-2.21.0:
      Successfully uninstalled ocrd-modelfactory-2.21.0
Successfully installed ocrd-modelfactory-2.21.0
Processing /home/user/ocrd_all/core/ocrd_validators
Requirement already satisfied: bagit>=1.7.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-validators==2.21.0) (1.7.0)
Requirement already satisfied: bagit_profile>=1.3.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-validators==2.21.0) (1.3.1)
Requirement already satisfied: click>=7 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-validators==2.21.0) (7.1.2)
Requirement already satisfied: jsonschema in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-validators==2.21.0) (3.2.0)
Requirement already satisfied: pyyaml in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-validators==2.21.0) (5.4.1)
Requirement already satisfied: shapely in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-validators==2.21.0) (1.7.1)
Requirement already satisfied: ocrd_utils==2.21.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-validators==2.21.0) (2.21.0)
Requirement already satisfied: ocrd_models==2.21.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-validators==2.21.0) (2.21.0)
Requirement already satisfied: ocrd_modelfactory==2.21.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-validators==2.21.0) (2.21.0)
Requirement already satisfied: lxml in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd_modelfactory==2.21.0->ocrd-validators==2.21.0) (4.6.2)
Requirement already satisfied: numpy in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd_utils==2.21.0->ocrd-validators==2.21.0) (1.19.5)
Requirement already satisfied: atomicwrites>=1.3.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd_utils==2.21.0->ocrd-validators==2.21.0) (1.4.0)
Requirement already satisfied: Pillow>=7.2.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd_utils==2.21.0->ocrd-validators==2.21.0) (8.1.0)
Requirement already satisfied: requests in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from bagit_profile>=1.3.0->ocrd-validators==2.21.0) (2.25.1)
Requirement already satisfied: pyrsistent>=0.14.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from jsonschema->ocrd-validators==2.21.0) (0.17.3)
Requirement already satisfied: six>=1.11.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from jsonschema->ocrd-validators==2.21.0) (1.15.0)
Requirement already satisfied: setuptools in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from jsonschema->ocrd-validators==2.21.0) (52.0.0)
Requirement already satisfied: attrs>=17.4.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from jsonschema->ocrd-validators==2.21.0) (20.3.0)
Requirement already satisfied: chardet<5,>=3.0.2 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from requests->bagit_profile>=1.3.0->ocrd-validators==2.21.0) (4.0.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from requests->bagit_profile>=1.3.0->ocrd-validators==2.21.0) (1.26.2)
Requirement already satisfied: idna<3,>=2.5 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from requests->bagit_profile>=1.3.0->ocrd-validators==2.21.0) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from requests->bagit_profile>=1.3.0->ocrd-validators==2.21.0) (2020.12.5)
Building wheels for collected packages: ocrd-validators
  Building wheel for ocrd-validators (setup.py) ... done
  Created wheel for ocrd-validators: filename=ocrd_validators-2.21.0-py3-none-any.whl size=57608 sha256=e81bdbc9afc722056f758dcbb72273a13879e79a7e01e810fb0f8ec72a6146a7
  Stored in directory: /tmp/pip-ephem-wheel-cache-kyjh1_kv/wheels/74/df/1c/b853ecbda6348128c5641f1ac659b96b44c3e863a37383a016
Successfully built ocrd-validators
Installing collected packages: ocrd-validators
  Attempting uninstall: ocrd-validators
    Found existing installation: ocrd-validators 2.21.0
    Uninstalling ocrd-validators-2.21.0:
      Successfully uninstalled ocrd-validators-2.21.0
Successfully installed ocrd-validators-2.21.0
Processing /home/user/ocrd_all/core/ocrd
Requirement already satisfied: bagit>=1.7.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd==2.21.0) (1.7.0)
Requirement already satisfied: bagit_profile>=1.3.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd==2.21.0) (1.3.1)
Requirement already satisfied: click>=7 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd==2.21.0) (7.1.2)
Requirement already satisfied: requests in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd==2.21.0) (2.25.1)
Requirement already satisfied: lxml in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd==2.21.0) (4.6.2)
Requirement already satisfied: opencv-python-headless in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd==2.21.0) (4.5.1.48)
Requirement already satisfied: Flask in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd==2.21.0) (1.1.2)
Requirement already satisfied: jsonschema in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd==2.21.0) (3.2.0)
Requirement already satisfied: pyyaml in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd==2.21.0) (5.4.1)
Requirement already satisfied: Deprecated==1.2.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd==2.21.0) (1.2.0)
Requirement already satisfied: ocrd_utils==2.21.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd==2.21.0) (2.21.0)
Requirement already satisfied: ocrd_models==2.21.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd==2.21.0) (2.21.0)
Requirement already satisfied: ocrd_modelfactory==2.21.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd==2.21.0) (2.21.0)
Requirement already satisfied: ocrd_validators==2.21.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd==2.21.0) (2.21.0)
Requirement already satisfied: wrapt<2,>=1 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from Deprecated==1.2.0->ocrd==2.21.0) (1.12.1)
Requirement already satisfied: atomicwrites>=1.3.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd_utils==2.21.0->ocrd==2.21.0) (1.4.0)
Requirement already satisfied: Pillow>=7.2.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd_utils==2.21.0->ocrd==2.21.0) (8.1.0)
Requirement already satisfied: numpy in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd_utils==2.21.0->ocrd==2.21.0) (1.19.5)
Requirement already satisfied: shapely in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd_validators==2.21.0->ocrd==2.21.0) (1.7.1)
Requirement already satisfied: itsdangerous>=0.24 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from Flask->ocrd==2.21.0) (1.1.0)
Requirement already satisfied: Werkzeug>=0.15 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from Flask->ocrd==2.21.0) (1.0.1)
Requirement already satisfied: Jinja2>=2.10.1 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from Flask->ocrd==2.21.0) (2.11.2)
Requirement already satisfied: MarkupSafe>=0.23 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from Jinja2>=2.10.1->Flask->ocrd==2.21.0) (1.1.1)
Requirement already satisfied: six>=1.11.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from jsonschema->ocrd==2.21.0) (1.15.0)
Requirement already satisfied: attrs>=17.4.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from jsonschema->ocrd==2.21.0) (20.3.0)
Requirement already satisfied: pyrsistent>=0.14.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from jsonschema->ocrd==2.21.0) (0.17.3)
Requirement already satisfied: setuptools in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from jsonschema->ocrd==2.21.0) (52.0.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from requests->ocrd==2.21.0) (1.26.2)
Requirement already satisfied: certifi>=2017.4.17 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from requests->ocrd==2.21.0) (2020.12.5)
Requirement already satisfied: chardet<5,>=3.0.2 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from requests->ocrd==2.21.0) (4.0.0)
Requirement already satisfied: idna<3,>=2.5 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from requests->ocrd==2.21.0) (2.10)
Building wheels for collected packages: ocrd
  Building wheel for ocrd (setup.py) ... done
  Created wheel for ocrd: filename=ocrd-2.21.0-py3-none-any.whl size=48584 sha256=d54c2dd75d3f0133c3fdc9fb1d8f32be9aefcfe7dcc4e2d762ddfec736c82a31
  Stored in directory: /tmp/pip-ephem-wheel-cache-1fwmx1xo/wheels/de/c4/b2/36cb47f012710bfd4496a60f2c3bca344a042eb88b487b8e86
Successfully built ocrd
Installing collected packages: ocrd
  Attempting uninstall: ocrd
    Found existing installation: ocrd 2.21.0
    Uninstalling ocrd-2.21.0:
      Successfully uninstalled ocrd-2.21.0
Successfully installed ocrd-2.21.0
make[2]: Leaving directory '/home/user/ocrd_all/core'
# workaround for core#351:
. /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/bin/activate && make -C core install PIP_INSTALL="pip3 install --no-deps --force-reinstall "
make[2]: Entering directory '/home/user/ocrd_all/core'
pip install -U "pip>=19.0.0" wheel
Requirement already satisfied: pip>=19.0.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (21.0)
Collecting pip>=19.0.0
  Using cached pip-21.0-py3-none-any.whl (1.5 MB)
  Using cached pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
Requirement already satisfied: wheel in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (0.36.2)
Collecting wheel
  Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
  Using cached wheel-0.36.1-py2.py3-none-any.whl (34 kB)
for mod in ocrd_utils ocrd_models ocrd_modelfactory ocrd_validators ocrd;do (cd $mod ; pip3 install --no-deps --force-reinstall  .);done
Processing /home/user/ocrd_all/core/ocrd_utils
Building wheels for collected packages: ocrd-utils
  Building wheel for ocrd-utils (setup.py) ... done
  Created wheel for ocrd-utils: filename=ocrd_utils-2.21.0-py3-none-any.whl size=17147 sha256=995700de48a27ae44a474a481ae500d6f9503138a77922853c092ef7e0216dbe
  Stored in directory: /tmp/pip-ephem-wheel-cache-c2fgavf5/wheels/b0/0a/c6/89c5884bbfacb3290f84c84b8249f5641f2863ad1b3bfdedae
Successfully built ocrd-utils
Installing collected packages: ocrd-utils
  Attempting uninstall: ocrd-utils
    Found existing installation: ocrd-utils 2.21.0
    Uninstalling ocrd-utils-2.21.0:
      Successfully uninstalled ocrd-utils-2.21.0
Successfully installed ocrd-utils-2.21.0
Processing /home/user/ocrd_all/core/ocrd_models
Building wheels for collected packages: ocrd-models
  Building wheel for ocrd-models (setup.py) ... done
  Created wheel for ocrd-models: filename=ocrd_models-2.21.0-py3-none-any.whl size=87958 sha256=def41bc50e0aa114d5c37f8827148e8555899e3b7c3f7a1d9eea4fbe85ba2b37
  Stored in directory: /tmp/pip-ephem-wheel-cache-kzdld4aq/wheels/1c/00/07/51a92d7320e63362463d9cd11a63d324ecf7887eadf9c512a7
Successfully built ocrd-models
Installing collected packages: ocrd-models
  Attempting uninstall: ocrd-models
    Found existing installation: ocrd-models 2.21.0
    Uninstalling ocrd-models-2.21.0:
      Successfully uninstalled ocrd-models-2.21.0
Successfully installed ocrd-models-2.21.0
Processing /home/user/ocrd_all/core/ocrd_modelfactory
Building wheels for collected packages: ocrd-modelfactory
  Building wheel for ocrd-modelfactory (setup.py) ... done
  Created wheel for ocrd-modelfactory: filename=ocrd_modelfactory-2.21.0-py3-none-any.whl size=2340 sha256=b31ce0efe44f333fcc9cb9a04324370acf4dc4986359eae99e1e0628e2a5d13d
  Stored in directory: /tmp/pip-ephem-wheel-cache-84a3vbf8/wheels/81/eb/bc/98b70d3493bc9ee6f5e63eee2f533202e135450d8b996fede1
Successfully built ocrd-modelfactory
Installing collected packages: ocrd-modelfactory
  Attempting uninstall: ocrd-modelfactory
    Found existing installation: ocrd-modelfactory 2.21.0
    Uninstalling ocrd-modelfactory-2.21.0:
      Successfully uninstalled ocrd-modelfactory-2.21.0
Successfully installed ocrd-modelfactory-2.21.0
Processing /home/user/ocrd_all/core/ocrd_validators
Building wheels for collected packages: ocrd-validators
  Building wheel for ocrd-validators (setup.py) ... done
  Created wheel for ocrd-validators: filename=ocrd_validators-2.21.0-py3-none-any.whl size=57608 sha256=a0f599c226f725159bef2ddafd84d584711faa9678172ff4b9f77b2969ffaf66
  Stored in directory: /tmp/pip-ephem-wheel-cache-7zf9dg8c/wheels/74/df/1c/b853ecbda6348128c5641f1ac659b96b44c3e863a37383a016
Successfully built ocrd-validators
Installing collected packages: ocrd-validators
  Attempting uninstall: ocrd-validators
    Found existing installation: ocrd-validators 2.21.0
    Uninstalling ocrd-validators-2.21.0:
      Successfully uninstalled ocrd-validators-2.21.0
Successfully installed ocrd-validators-2.21.0
Processing /home/user/ocrd_all/core/ocrd
Building wheels for collected packages: ocrd
  Building wheel for ocrd (setup.py) ... done
  Created wheel for ocrd: filename=ocrd-2.21.0-py3-none-any.whl size=48584 sha256=17049ec143aae85175106ea678524add59a8958bde475867012f6cebaab290d8
  Stored in directory: /tmp/pip-ephem-wheel-cache-njk7q5ub/wheels/de/c4/b2/36cb47f012710bfd4496a60f2c3bca344a042eb88b487b8e86
Successfully built ocrd
Installing collected packages: ocrd
  Attempting uninstall: ocrd
    Found existing installation: ocrd 2.21.0
    Uninstalling ocrd-2.21.0:
      Successfully uninstalled ocrd-2.21.0
Successfully installed ocrd-2.21.0
make[2]: Leaving directory '/home/user/ocrd_all/core'
. /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/bin/activate && cd cor-asv-ann && pip3 install  .
Processing /home/user/ocrd_all/cor-asv-ann
Requirement already satisfied: ocrd>=2.20.0 in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-cor-asv-ann==0.1.6) (2.21.0)
Requirement already satisfied: click in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-cor-asv-ann==0.1.6) (7.1.2)
Collecting keras==2.3.*
  Downloading Keras-2.3.1-py2.py3-none-any.whl (377 kB)
     |████████████████████████████████| 377 kB 5.2 MB/s 
Requirement already satisfied: numpy in /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/lib/python3.8/site-packages (from ocrd-cor-asv-ann==0.1.6) (1.19.5)
ERROR: Could not find a version that satisfies the requirement tensorflow-gpu==1.15.* (from ocrd-cor-asv-ann)
ERROR: No matching distribution found for tensorflow-gpu==1.15.*
make[1]: *** [Makefile:229: /home/user/ocrd_all/venv/local/sub-venv/headless-tf1/bin/ocrd-cor-asv-ann-evaluate] Error 1
make[1]: Leaving directory '/home/user/ocrd_all'
make: *** [Makefile:224: /home/user/ocrd_all/venv/bin/ocrd-cor-asv-ann-evaluate] Error 2
make: *** Deleting file '/home/user/ocrd_all/venv/bin/ocrd-cor-asv-ann-evaluate'
make: *** [/home/user/ocrd_all/venv/bin/ocrd-cor-asv-ann-evaluate] Deleting file '/home/user/ocrd_all/venv/bin/cor-asv-ann-repl'
make: *** [/home/user/ocrd_all/venv/bin/ocrd-cor-asv-ann-evaluate] Deleting file '/home/user/ocrd_all/venv/bin/cor-asv-ann-eval'
make: *** [/home/user/ocrd_all/venv/bin/ocrd-cor-asv-ann-evaluate] Deleting file '/home/user/ocrd_all/venv/bin/cor-asv-ann-train'
make: *** [/home/user/ocrd_all/venv/bin/ocrd-cor-asv-ann-evaluate] Deleting file '/home/user/ocrd_all/venv/bin/ocrd-cor-asv-ann-process'
@stweil
Copy link
Collaborator

stweil commented Jan 25, 2021

That's a known "feature". You need Python 3.7. See https://github.com/OCR-D/ocrd-website/wiki/OCR-D-on-Debian-and-Ubuntu for more information. Or you can restrict your installation to processors without older Tensorflow.

@stweil
Copy link
Collaborator

stweil commented Jan 27, 2021

@kba, @bertsky, I think this scenario will happen more often as all recent Linux distributions have newer versions of Python. Maybe we should detect that early in the Makefile and either terminate with a prominent message or continue after such message, but omit everything which requires older versions of Tensorflow.

@bertsky
Copy link
Collaborator

bertsky commented Jan 27, 2021

Maybe we should detect that early in the Makefile and either terminate with a prominent message or continue after such message, but omit everything which requires older versions of Tensorflow.

We've had that discussion in #147 – where no-one came up with a concrete proposal yet – but what's the point in just throwing a more clever error message, if what we really want is to actually support these platforms?

IMO we should invest the time to solve delegation to thin Docker layers instead. (We could even have an automatism which only delegates to Docker if the native recipe failed.)

@bertsky
Copy link
Collaborator

bertsky commented Jun 16, 2021

It seems we could avoid at least some of these problems by relying on the TF 1.15 wheels prebuilt by Nvidia.

There may be more. (For example, see here or here or here or here.)

Or we do permit ourselves falling for conda – at least for the "sub-venvs" ...

@stweil
Copy link
Collaborator

stweil commented Jun 16, 2021

Technically we could add our own OCR-D Python repository and provide missing packages there, something like https://digi.bib.uni-mannheim.de/pypi/. But maintaining that for Tensorflow would be a huge burden.

@bertsky
Copy link
Collaborator

bertsky commented Jun 16, 2021

It seems we could avoid at least some of these problems by relying on the TF 1.15 wheels prebuildt by Nvidia.

That's actually quite straightforward: We don't need to download stuff from https://github.com/NVIDIA/tensorflow, just add the Nvidia server to the list of indexes searched by pip locally, which can be done by:

pip install nvidia-pyindex

After that, you can do:

pip install nvidia-tensorflow

And get a fresh Python 3.8 compatible TF 1.15.5 – alas, under the wrong distribution name. All our modules depend on either tensorflow or tensorflow_gpu, so we still need a way to alias nvidia_tensorflow to that.

You should think this is an easy task that should be supported by pip/wheel out of the box. Turns out: it isn't! I only found this recipe to create alias packages. In addition, the following seems to work (amazingly):

pip download --no-deps nvidia-tensorflow
for name in nvidia_tensorflow-*.whl; do name=${name%.whl}; done
python -m wheel unpack $name.whl
for name in nvidia_tensorflow-*/; do name=${name%/}; done
newname=${name/nvidia_tensorflow/tensorflow_gpu}
sed -i s/nvidia_tensorflow/tensorflow_gpu/ $name/$name.dist-info/METADATA
sed -i s/nvidia_tensorflow/tensorflow_gpu/ $name/$name.dist-info/RECORD
sed -i s/nvidia_tensorflow/tensorflow_gpu/ $name/tensorflow_core/tools/pip_package/setup.py
mv $name/$name.dist-info $name/$newname.dist-info
mv $name/$name.data $name/$newname.data
python -m wheel pack $name
pip install $newname*.whl

We could easily write a fixture for all our TF1 sub-venvs using this in the makefile.

Opinions anyone?

@bertsky
Copy link
Collaborator

bertsky commented Jun 16, 2021

Technically we could add our own OCR-D Python repository and provide missing packages there, something like https://digi.bib.uni-mannheim.de/pypi/. But maintaining that for Tensorflow would be a huge burden.

Agreed. TF builds bind lots of CPU and network resources. If the above Nvidia recipe does not work, we could still try with any of the other prebuilt wheels linked above (which already come under the correct distribution name), and add their URLs to our index via PIP_OPTIONS += --extra-index-url URL. That should do the trick transparently – if a distribution cannot be found on PyPI, pip will try the additional servers. At that point, if we still find some combination lacking, we could build that (and only that), upload it somewhere and add its server URL.

@kba
Copy link
Member

kba commented Jun 17, 2021

pip install nvidia-pyindex

Did not know that, sweet.

pip download --no-deps nvidia-tensorflow
for name in nvidia_tensorflow-*.whl; do name=${name%.whl}; done
python -m wheel unpack $name.whl
for name in nvidia_tensorflow-*/; do name=${name%/}; done
newname=${name/nvidia_tensorflow/tensorflow_gpu}
sed -i s/nvidia_tensorflow/tensorflow_gpu/ $name/$name.dist-info/METADATA
sed -i s/nvidia_tensorflow/tensorflow_gpu/ $name/$name.dist-info/RECORD
sed -i s/nvidia_tensorflow/tensorflow_gpu/ $name/tensorflow_core/tools/pip_package/setup.py
mv $name/$name.dist-info $name/$newname.dist-info
mv $name/$name.data $name/$newname.data
python -m wheel pack $name
pip install $newname*.whl

It's a hack, sure, but a sensible one I think and better than having to change the imports and definitely worth it if we can reliably get TF wheels for all Python versions.

@bertsky
Copy link
Collaborator

bertsky commented Jun 17, 2021

Yes. And among the 4 other links given above, only this had a recent TF1 – but the nvidia repo offers more options.

@bertsky
Copy link
Collaborator

bertsky commented Jul 14, 2021

Note: I edited the above recipe (also in your verbatim copy) to make them work automatically.

@bertsky
Copy link
Collaborator

bertsky commented Jul 14, 2021

Alas, tensorflow_core/python/_pywrap_tensorflow_internal.so is linked against GLIBC 2.29, which fails to run on Ubuntu 18.04 (2.27). I don't know why Nvidia did this (and how such overly restrictive dependencies are avoided under normal circumstances), but this currently prevents us from using this as a fix.

@bertsky
Copy link
Collaborator

bertsky commented Jul 14, 2021

Yes. And among the 4 other links given above, only this had a recent TF1 – but the nvidia repo offers more options.

Sadly, that wheel, too, depends on GLIBC 2.29.

@kba kba added the bug Something isn't working label Aug 31, 2021
@bertsky
Copy link
Collaborator

bertsky commented Nov 27, 2021

Alas, tensorflow_core/python/_pywrap_tensorflow_internal.so is linked against GLIBC 2.29, which fails to run on Ubuntu 18.04 (2.27). I don't know why Nvidia did this (and how such overly restrictive dependencies are avoided under normal circumstances), but this currently prevents us from using this as a fix.

see here

Yes. And among the 4 other links given above, only this had a recent TF1 – but the nvidia repo offers more options.

Sadly, that wheel, too, depends on GLIBC 2.29.

see here

Not even Anaconda provides the combination TF<2 Python>3.7:

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - tensorflow==1.15 -> python[version='2.7.*|3.6.*|3.7.*']

Your python: python=3.8

@bertsky
Copy link
Collaborator

bertsky commented Jan 12, 2022

And the combination TF=~2.1 Python>3.7 (which we need for ocrd_anybaseocr) is even more difficult to get by.

@bertsky
Copy link
Collaborator

bertsky commented Jan 29, 2022

Yes. And among the 4 other links given above, only this had a recent TF1 – but the nvidia repo offers more options.

Alas, tensorflow_core/python/_pywrap_tensorflow_internal.so is linked against GLIBC 2.29, which fails to run on Ubuntu 18.04 (2.27). I don't know why Nvidia did this (and how such overly restrictive dependencies are avoided under normal circumstances), but this currently prevents us from using this as a fix.

It works now. But it comes with the same caveat as the multi-CUDA solution: you need to update your host system's driver.

So at least for TF 1.15 (i.e. our headless-tf1 venv), we could prepend a line

	$(pip_install_tf1nvidia)

to all recipes involving that venv (just before the normal pip_install line). The full canned recipe for the above fixture could then be formulated like this

SHELL = /bin/bash
define pip_install_tf1nvidia =
. $(ACTIVATE_VENV) && if ! $(PIP) show -q tensorflow-gpu; then \
	$(PIP) install nvidia-pyindex && \
	pushd $$(mktemp -d) && \
	$(PIP) download --no-deps nvidia-tensorflow && \
	for name in nvidia_tensorflow-*.whl; do name=$${name%.whl}; done && \
	$(PYTHON) -m wheel unpack $$name.whl && \
	for name in nvidia_tensorflow-*/; do name=$${name%/}; done && \
	newname=$${name/nvidia_tensorflow/tensorflow_gpu} &&\
	sed -i s/nvidia_tensorflow/tensorflow_gpu/g $$name/$$name.dist-info/METADATA && \
	sed -i s/nvidia_tensorflow/tensorflow_gpu/g $$name/$$name.dist-info/RECORD && \
	sed -i s/nvidia_tensorflow/tensorflow_gpu/g $$name/tensorflow_core/tools/pip_package/setup.py && \
	pushd $$name && for path in $$name*; do mv $$path $${path/$$name/$$newname}; done && popd && \
	$(PYTHON) -m wheel pack $$name && \
	$(PIP) install $$newname*.whl && popd && rm -fr $$OLDPWD; fi
endef

(or in a separate shell script)

@bertsky
Copy link
Collaborator

bertsky commented Feb 18, 2022

I have a working solution to integrate this into Docker build, too. (By passing PYTHON version into deps-ubuntu etc.)

But we still lack a prebuild for this TF 2.1:

And the combination TF=~2.1 Python>3.7 (which we need for ocrd_anybaseocr) is even more difficult to get by.

@kba, do you remember why you restricted ocrd_anybaseocr to tensorflow<2.2?

@kba
Copy link
Member

kba commented Feb 18, 2022

And the combination TF=~2.1 Python>3.7 (which we need for ocrd_anybaseocr) is even more difficult to get by.

@kba, do you remember why you restricted ocrd_anybaseocr to tensorflow<2.2?

I think because the loading the pretrained models led to VersionConflict with tf >= 2.2. But that might have been too strict, not sure.

@bertsky
Copy link
Collaborator

bertsky commented Feb 18, 2022

I think because the loading the pretrained models led to VersionConflict with tf >= 2.2. But that might have been too strict, not sure.

Unfortunately, I cannot find any discussion/mention of this.
If I run make -C ocrd_anybase cli-test on Python 3.8 / TF 2.8, I do get something that looks like a binary model incompatibility problem:

  File "/usr/local/sub-venv/headless-tf2/lib/python3.8/site-packages/ocrd_anybaseocr/cli/ocrd_anybaseocr_tiseg.py", line 60, in setup
    self.model = load_model(model_weights)
  File "/usr/local/sub-venv/headless-tf2/lib/python3.8/site-packages/keras/utils/traceback_utils.py", line 67, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/usr/local/sub-venv/headless-tf2/lib/python3.8/site-packages/keras/utils/generic_utils.py", line 793, in func_load
    code = marshal.loads(raw_code)
ValueError: bad marshal data (unknown type code)

@bertsky
Copy link
Collaborator

bertsky commented Feb 19, 2022

If I run make -C ocrd_anybase cli-test on Python 3.8 / TF 2.8, I do get something that looks like a binary model incompatibility problem:

See OCR-D/ocrd_anybaseocr#89 for a solution in ocrd_anybaseocr and #289 for a general solution including all of the above.

@bertsky bertsky linked a pull request Feb 21, 2022 that will close this issue
@stweil
Copy link
Collaborator

stweil commented Mar 25, 2022

This issue was solved with #289 for Python 3.8, but for Python 3.9 and Python 3.10 there is still the same problem. For those and any newer Python version it is no longer possible to provide a tensorflow-gpu package. Pull request #295 therefore uses a different fix and disables all submodules which require that unavailable package. That fixes make all, too, but installs a smaller set of processors of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants