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

Keras 3 compatibility #2170

Merged
merged 9 commits into from
Nov 20, 2023
Merged

Keras 3 compatibility #2170

merged 9 commits into from
Nov 20, 2023

Conversation

divyashreepathihalli
Copy link
Collaborator

@divyashreepathihalli divyashreepathihalli commented Nov 20, 2023

Uses tf.random.Generator instead of keras.backend.RandomGenerator
removed legacy_make_seed

Tests disabled - #2167

all 3d preprocessing tests - has legacy baserandomlayer
rand_augment_test - need to investigate
random_shear_test - need to investigate
repeated_augmentation_test - need to investigate
resizing_test - has ragged tensor tests and is failing on jax and torch
SqueezeAndExcite2D - serialization test

* Keras3 tests (#2152)

* Update requirements for Keras 3

* Update Requirements

* Update Requirements

* Add randint for keras3 compatibility

* remove force generator

* fix few tests

* fix tests

* fix more tests

* Update actions.yml

* Tf generator changes (#2162)

* Keras3 tests (#2152)

* Update requirements for Keras 3

* Update Requirements

* Update Requirements

* Add randint for keras3 compatibility

* remove force generator

* fix few tests

* fix tests

* fix more tests

* Revert "Replace `RandomGenerator` with `SeedGenerator` (#2150)" (#2161)

This reverts commit 365a675.

* Update actions.yml

---------

Co-authored-by: Ramesh Sampath <1437573+sampathweb@users.noreply.github.com>

* updates to rescaling

* fix import

* code reformat

* namescope

* update name_scope

* correct ops.random

* update base aug layer

* code reformat

* skip rand_augment test

* disable random shear test

* skip test

* update import

* fix format and base layer

* ads smart resize

* undo last commit

* smart_resize update

* update imports

* correct shameful spelling mistake

* update resizing

* update resizing

* update imports

* disable ragged tensor test

* skip tests

* change back translation and zoom test

* revert test changes

* update

* skip repeated augmentation tests

* disable random shear test

* code reformat

* remove legacy_seed

* code reformat

* revert updates to tests

* update tests

* fix mock test

---------

Co-authored-by: Ramesh Sampath <1437573+sampathweb@users.noreply.github.com>
@sampathweb sampathweb changed the title Keras 3 updates Keras 3 compatibility Nov 20, 2023
@divyashreepathihalli
Copy link
Collaborator Author

/gcbrun

Copy link
Member

@mattdangerw mattdangerw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Don't have great visibility into what layers we need to disable for Keras 3 temporarily. But code overall looks clean!

.github/workflows/release.yml Outdated Show resolved Hide resolved
from keras_cv.layers import preprocessing_3d
from keras_cv.layers.preprocessing_3d import base_augmentation_layer_3d
from keras_cv.tests.test_case import TestCase

POINT_CLOUDS = base_augmentation_layer_3d.POINT_CLOUDS
BOUNDING_BOXES = base_augmentation_layer_3d.BOUNDING_BOXES
if not keras_3():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason we can't just do this with the pytest annotation like elsewhere?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TEST_CONDITIONS list would also need to be moved inside the tests since those layers are also not compatible with Keras 3. So left it as-is for now. We can update it once we make them keras 3 compatible.

keras_cv/layers/serialization_test.py Outdated Show resolved Hide resolved
requirements.txt Show resolved Hide resolved
@divyashreepathihalli
Copy link
Collaborator Author

/gcbrun

@sampathweb sampathweb merged commit 40ae4ae into master Nov 20, 2023
14 of 17 checks passed
@sampathweb sampathweb deleted the keras-3-updates branch November 20, 2023 20:40
yuvraj-wale pushed a commit to yuvraj-wale/keras-cv that referenced this pull request Feb 8, 2024
* Tf generator changes (keras-team#2168)

* Keras3 tests (keras-team#2152)

* Update requirements for Keras 3

* Update Requirements

* Update Requirements

* Add randint for keras3 compatibility

* remove force generator

* fix few tests

* fix tests

* fix more tests

* Update actions.yml

* Tf generator changes (keras-team#2162)

* Keras3 tests (keras-team#2152)

* Update requirements for Keras 3

* Update Requirements

* Update Requirements

* Add randint for keras3 compatibility

* remove force generator

* fix few tests

* fix tests

* fix more tests

* Revert "Replace `RandomGenerator` with `SeedGenerator` (keras-team#2150)" (keras-team#2161)

This reverts commit 365a675.

* Update actions.yml

---------

Co-authored-by: Ramesh Sampath <1437573+sampathweb@users.noreply.github.com>

* updates to rescaling

* fix import

* code reformat

* namescope

* update name_scope

* correct ops.random

* update base aug layer

* code reformat

* skip rand_augment test

* disable random shear test

* skip test

* update import

* fix format and base layer

* ads smart resize

* undo last commit

* smart_resize update

* update imports

* correct shameful spelling mistake

* update resizing

* update resizing

* update imports

* disable ragged tensor test

* skip tests

* change back translation and zoom test

* revert test changes

* update

* skip repeated augmentation tests

* disable random shear test

* code reformat

* remove legacy_seed

* code reformat

* revert updates to tests

* update tests

* fix mock test

---------

Co-authored-by: Ramesh Sampath <1437573+sampathweb@users.noreply.github.com>

* Skip keras 3 incompatible layers (keras-team#2169)

* Update requirements.txt

* disable flaky test

* code reformat

* fixes tests on coco metric and serialization

* code reformat

* Skip test on RandAugment

* Skip test on RandAugment

---------

Co-authored-by: Ramesh Sampath <1437573+sampathweb@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants