Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove direct imports of tf.keras #2048

Merged
merged 3 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion keras_cv/callbacks/pycoco_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import numpy as np
from keras.callbacks import Callback
from tensorflow.keras.callbacks import Callback

from keras_cv import bounding_box
from keras_cv.api_export import keras_cv_export
Expand Down
7 changes: 3 additions & 4 deletions keras_cv/callbacks/waymo_evaluation_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import tensorflow as tf
from keras.callbacks import Callback
from tensorflow.keras.callbacks import Callback

from keras_cv.api_export import keras_cv_export
from keras_cv.bounding_box_3d import CENTER_XYZ_DXDYDZ_PHI
from keras_cv.utils import assert_waymo_open_dataset_installed

try:
Expand All @@ -26,9 +28,6 @@
except ImportError:
WODDetectionEvaluator = None

from keras_cv.api_export import keras_cv_export
from keras_cv.bounding_box_3d import CENTER_XYZ_DXDYDZ_PHI


@keras_cv_export("keras_cv.callbacks.WaymoEvaluationCallback")
class WaymoEvaluationCallback(Callback):
Expand Down
2 changes: 1 addition & 1 deletion keras_cv/layers/preprocessing/random_zoom.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


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

from keras_cv.api_export import keras_cv_export
from keras_cv.layers.preprocessing.vectorized_base_image_augmentation_layer import ( # noqa: E501
Expand Down
2 changes: 1 addition & 1 deletion keras_cv/models/legacy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
# ==============================================================================
"""Utility functions for models"""

from keras import layers
from tensorflow import keras
from tensorflow.keras import layers


def parse_model_inputs(input_shape, input_tensor):
Expand Down
2 changes: 1 addition & 1 deletion keras_cv/models/legacy/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.
"""Tests for KerasCV model utils."""

from keras import layers
from tensorflow import keras
from tensorflow.keras import layers

from keras_cv.models.legacy import utils
from keras_cv.tests.test_case import TestCase
Expand Down
2 changes: 1 addition & 1 deletion keras_cv/models/legacy/weights.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
import tensorflow as tf
from keras import utils
from tensorflow.keras import utils


def parse_weights(weights, include_top, model_type):
Expand Down
2 changes: 1 addition & 1 deletion keras_cv/models/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
"""Tests for KerasCV model utils."""

from keras import layers
from tensorflow.keras import layers

from keras_cv.models import utils
from keras_cv.tests.test_case import TestCase
Expand Down