From e5acee09abb3e291fc6b3b48c3655648422cad40 Mon Sep 17 00:00:00 2001 From: Clemens Neudecker <952378+cneud@users.noreply.github.com> Date: Thu, 17 Aug 2023 21:05:51 +0200 Subject: [PATCH 1/4] cap tensorflow version to <2.12.0 Cap tensorflow version to <2.12.0 until we have time to adapt to the API changes such as e.g. * Support for Python 3.11 has been added. * Support for Python 3.7 has been removed. See also https://github.com/tensorflow/tensorflow/releases/tag/v2.12.0. --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0180d01..0d7c5b2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ # ocrd includes opencv, numpy, shapely, click ocrd >= 2.23.3 scikit-learn >= 0.23.2 -tensorflow >= 2.4.0 +tensorflow >= 2.4.0, <2.12.0 imutils >= 0.5.3 matplotlib setuptools >= 50 From 935332e86352b86453cdc61fcd548f484a5d3ae3 Mon Sep 17 00:00:00 2001 From: Clemens Neudecker <952378+cneud@users.noreply.github.com> Date: Thu, 17 Aug 2023 21:45:48 +0200 Subject: [PATCH 2/4] test fix for keras.backend import error with Python 3.8 --- qurator/eynollah/eynollah.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qurator/eynollah/eynollah.py b/qurator/eynollah/eynollah.py index ad3f312..57ddcad 100644 --- a/qurator/eynollah/eynollah.py +++ b/qurator/eynollah/eynollah.py @@ -29,7 +29,7 @@ warnings.filterwarnings("ignore") from scipy.signal import find_peaks import matplotlib.pyplot as plt from scipy.ndimage import gaussian_filter1d -from keras.backend import set_session +from tensorflow.python.keras.backend import set_session from tensorflow.keras import layers from .utils.contour import ( From b58a327c5d53a05ba3142802db27e25dfd7380be Mon Sep 17 00:00:00 2001 From: Clemens Neudecker <952378+cneud@users.noreply.github.com> Date: Thu, 17 Aug 2023 22:07:45 +0200 Subject: [PATCH 3/4] cap numpy to <1.24.0 OK so now numpy is the culprit (shipped unbound via ocrd) which had several deprecations expire with release of v1.24.0 that require changes to our codebase, e.g. * The deprecation for the aliases np.object, np.bool, np.float, np.complex, np.str, and np.int is expired * Ragged array creation will now always raise a ValueError unless dtype=object is passed. See also here: https://numpy.org/devdocs/release/1.24.0-notes.html#expired-deprecations --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 0d7c5b2..a19a191 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ # ocrd includes opencv, numpy, shapely, click ocrd >= 2.23.3 +numpy <1.24.0 scikit-learn >= 0.23.2 tensorflow >= 2.4.0, <2.12.0 imutils >= 0.5.3 From 3e6265757060a414370d21a5edceb3297a0f5d8b Mon Sep 17 00:00:00 2001 From: Clemens Neudecker <952378+cneud@users.noreply.github.com> Date: Thu, 17 Aug 2023 23:02:10 +0200 Subject: [PATCH 4/4] added the TF upper bound in the README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d74c4a9..f17d194 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,9 @@ * [OCR-D](https://github.com/qurator-spk/eynollah#use-as-ocr-d-processor) interface ## Installation -Python versions `3.7-3.10` with Tensorflow `>=2.4` are currently supported. +Python versions `3.7-3.10` with Tensorflow versions `2.4-2.11` are currently supported. -For (limited) GPU support the [matching](https://www.tensorflow.org/install/source#gpu) CUDA toolkit `>=10.1` needs to be installed. +For (limited) GPU support the [matching](https://www.tensorflow.org/install/source#gpu) CUDA toolkit needs to be installed. You can either install via