Skip to content

Commit

Permalink
Switch back to tf 2.12 as minimum version (#1934)
Browse files Browse the repository at this point in the history
* Switch back to tf 2.12 as minimum version

* Update backend shim

* Handle multiplex directly in kpls
  • Loading branch information
ianstenbit authored Jul 11, 2023
1 parent 7a06394 commit d507a95
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import keras
import tensorflow as tf
from keras.src import backend as keras_backend

if hasattr(keras, "src"):
keras_backend = keras.src.backend
else:
keras_backend = keras.backend

from keras_cv import bounding_box
from keras_cv.backend import keras
Expand Down Expand Up @@ -118,7 +123,7 @@ def augment_image(self, image, transformation):
```
Note that since the randomness is also a common functionality, this layer
also includes a keras.backend.RandomGenerator, which can be used to
also includes a keras_backend.RandomGenerator, which can be used to
produce the random numbers. The random number generator is stored in the
`self._random_generator` attribute.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import keras
import tensorflow as tf
from keras.src import backend as keras_backend

if hasattr(keras, "src"):
keras_backend = keras.src.backend
else:
keras_backend = keras.backend

from keras_cv import bounding_box
from keras_cv.backend import keras
Expand Down Expand Up @@ -97,7 +102,7 @@ def __init__(self):
```
Note that since the randomness is also a common functionality, this layer
also includes a keras.backend.RandomGenerator, which can be used to
also includes a keras_backend.RandomGenerator, which can be used to
produce the random numbers. The random number generator is stored in the
`self._random_generator` attribute.
"""
Expand Down
2 changes: 1 addition & 1 deletion keras_cv/version_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import tensorflow as tf
from packaging.version import parse

MIN_VERSION = "2.13.0"
MIN_VERSION = "2.12.0"


def check_tf_version():
Expand Down
4 changes: 2 additions & 2 deletions keras_cv/version_check_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ def cleanup_tf_version():


def test_check_tf_version_error():
tf.__version__ = "2.12.0"
tf.__version__ = "2.11.0"

with pytest.raises(
RuntimeError,
match="Tensorflow package version needs to be at least 2.13.0",
match="Tensorflow package version needs to be at least 2.12.0",
):
version_check.check_tf_version()

Expand Down

0 comments on commit d507a95

Please sign in to comment.