From e733c41ec13a3cc76fb1a2e24d15ec4554b0e3e8 Mon Sep 17 00:00:00 2001 From: "Arun S. Maiya" Date: Fri, 5 Apr 2024 14:30:40 -0400 Subject: [PATCH] use TF 2.15 in CI --- .github/workflows/ci.yml | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d789223e..6549fc4a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: pip install -U pip wheel pip install -e . pip install ipython - pip install tensorflow_cpu + pip install tensorflow_cpu==2.15.1 pip install jinja2==3.0.3 # eli5 dep issue pip install https://github.com/amaiya/eli5-tf/archive/refs/heads/master.zip - name: Show installed pip dependencies diff --git a/README.md b/README.md index e5c8a3d86..45b7dab9c 100644 --- a/README.md +++ b/README.md @@ -311,7 +311,7 @@ learner.evaluate(tst, class_names=preproc.get_classes()) 1. Make sure pip is up-to-date with: `pip install -U pip` -2. [Install TensorFlow 2](https://www.tensorflow.org/install) if it is not already installed (e.g., `pip install tensorflow==2.15.1`). Note that `tensorflow>=2.16` is not yet supported due to breaking changes in Keras 3. +2. [Install TensorFlow 2](https://www.tensorflow.org/install) if it is not already installed (e.g., `pip install tensorflow==2.15.1`). 3. Install *ktrain*: `pip install ktrain` @@ -322,7 +322,7 @@ The above should be all you need on Linux systems and cloud computing environmen #### Notes about TensorFlow Versions - As of `tensorflow>=2.11`, you must only use legacy optimizers such as `tf.keras.optimizers.legacy.Adam`. The newer `tf.keras.optimizers.Optimizer` base class is not supported at this time. For instance, when using TensorFlow 2.11 and above, please use `tf.keras.optimzers.legacy.Adam()` instead of the string `"adam"` in `model.compile`. **ktrain** does this automatically when using out-of-the-box models (e.g., models from the `transformers` library). -- On Google Colab, if you receive an error such as `model is not an instance of Model`, ensure the version of `tf_keras` installed exactly matches the version of Tensorflow (e.g., `pip install tensorflow==2.15.1 tf_keras==2.15.1`). +- Due to breaking changes in TensorFlow 2.16, you will need to install the `tf_keras` package and also set the environment variable `TF_USE_LEGACY_KERAS=True` before importing **ktrain**. #### Additional Notes About Installation