Skip to content

Commit d9ac89a

Browse files
authored
Remove direct imports of tf.keras (keras-team#2048)
* Remove direct imports of keras * Undo change in predict_utils * Undo augmentation layer changes
1 parent 6651b2a commit d9ac89a

File tree

7 files changed

+9
-10
lines changed

7 files changed

+9
-10
lines changed

keras_cv/callbacks/pycoco_callback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
import numpy as np
15-
from keras.callbacks import Callback
15+
from tensorflow.keras.callbacks import Callback
1616

1717
from keras_cv import bounding_box
1818
from keras_cv.api_export import keras_cv_export

keras_cv/callbacks/waymo_evaluation_callback.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
import tensorflow as tf
15-
from keras.callbacks import Callback
15+
from tensorflow.keras.callbacks import Callback
1616

17+
from keras_cv.api_export import keras_cv_export
18+
from keras_cv.bounding_box_3d import CENTER_XYZ_DXDYDZ_PHI
1719
from keras_cv.utils import assert_waymo_open_dataset_installed
1820

1921
try:
@@ -26,9 +28,6 @@
2628
except ImportError:
2729
WODDetectionEvaluator = None
2830

29-
from keras_cv.api_export import keras_cv_export
30-
from keras_cv.bounding_box_3d import CENTER_XYZ_DXDYDZ_PHI
31-
3231

3332
@keras_cv_export("keras_cv.callbacks.WaymoEvaluationCallback")
3433
class WaymoEvaluationCallback(Callback):

keras_cv/layers/preprocessing/random_zoom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
import tensorflow as tf
17-
from keras import backend
17+
from tensorflow.keras import backend
1818

1919
from keras_cv.api_export import keras_cv_export
2020
from keras_cv.layers.preprocessing.vectorized_base_image_augmentation_layer import ( # noqa: E501

keras_cv/models/legacy/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# ==============================================================================
1515
"""Utility functions for models"""
1616

17-
from keras import layers
1817
from tensorflow import keras
18+
from tensorflow.keras import layers
1919

2020

2121
def parse_model_inputs(input_shape, input_tensor):

keras_cv/models/legacy/utils_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# limitations under the License.
1414
"""Tests for KerasCV model utils."""
1515

16-
from keras import layers
1716
from tensorflow import keras
17+
from tensorflow.keras import layers
1818

1919
from keras_cv.models.legacy import utils
2020
from keras_cv.tests.test_case import TestCase

keras_cv/models/legacy/weights.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
import tensorflow as tf
14-
from keras import utils
14+
from tensorflow.keras import utils
1515

1616

1717
def parse_weights(weights, include_top, model_type):

keras_cv/models/utils_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
"""Tests for KerasCV model utils."""
1515

16-
from keras import layers
16+
from tensorflow.keras import layers
1717

1818
from keras_cv.models import utils
1919
from keras_cv.tests.test_case import TestCase

0 commit comments

Comments
 (0)