From 4883a178648c6f578d0390aaa5ef3cb69fec1ff4 Mon Sep 17 00:00:00 2001 From: divyashreepathihalli Date: Tue, 7 Nov 2023 06:28:23 +0000 Subject: [PATCH] reformat --- keras_cv/backend/__init__.py | 1 + keras_cv/backend/config.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keras_cv/backend/__init__.py b/keras_cv/backend/__init__.py index ea49fd9ccd..0e40b8e643 100644 --- a/keras_cv/backend/__init__.py +++ b/keras_cv/backend/__init__.py @@ -46,6 +46,7 @@ from tensorflow import keras elif multi_backend(): import keras + if not hasattr(keras, "__version__") or parse(keras.__version__) < parse( "3.0" ): diff --git a/keras_cv/backend/config.py b/keras_cv/backend/config.py index 06cb5e344e..cf830fbe1e 100644 --- a/keras_cv/backend/config.py +++ b/keras_cv/backend/config.py @@ -14,8 +14,6 @@ import json import os -from packaging.version import parse - _MULTI_BACKEND = False # Set Keras base dir path given KERAS_HOME env variable, if applicable. @@ -43,6 +41,7 @@ def detect_if_tensorflow_uses_keras_3(): def detect_if_keras_3(): import keras + if hasattr(keras, "__version__") and keras.__version__.startswith("3."): return True else: