-
Notifications
You must be signed in to change notification settings - Fork 301
Support Keras 3 installation #1258
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
Support Keras 3 installation #1258
Conversation
/gcbrun |
_MULTI_BACKEND = True | ||
|
||
# If keras is version 3, use multi-backend keras (our only option). | ||
_IS_KERAS_3 = version.parse(keras.__version__) >= version.parse("3.0.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My reading of this is that if Keras3 is installed, we force use of Keras3 instead of tf.keras -- I think that's probably fine but want to make sure it's the intent so I can do the same on KerasCV
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we see Keras 3 as the main import keras
we should probably just use it? I don't see a big reason to support a legacy path of import tf_keras
, but we could always add it down the road.
It does not sounds like any package is going to directly depend on tf-keras
, so I don't think we can rely on it being installed unless we add a dep at some point.
What do you think? Is there and alternative you were considering?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that seems reasonable.
My plan was to stick to the same behavior for now (using tf.keras unless a backend is specified), but I think we should move toward dropping support for tf.keras and instead use keras core only.
In fact, I'd support doing that as soon as the 0.7 releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think overall this should be sticking to the same behavior. tf.keras
(which is keras==2.x
installed with tensorflow
) is the default out of the box.
The issue is mainly that if a user does install Keras 3 (via source or eventual pip package), I don't think we can guarantee there is another keras to load. from tensorflow import keras
will get you Keras 3 unless the user has manually done pip install tf-keras
and TF_USE_LEGACY_KERAS
.
/gcbrun |
95c75c8
to
28c4589
Compare
/gcbrun |
Currently this is only available via github. Eventually this will be available via `pip install keras`. We need it know to support testing against the latest keras changes. As part of this changes, we will also move our off any private, unexported symbols (no more keras_core.src).
28c4589
to
9ebf0ed
Compare
/gcbrun |
43f2b8f
to
e310931
Compare
/gcbrun |
* Support Keras 3 installation Currently this is only available via github. Eventually this will be available via `pip install keras`. We need it know to support testing against the latest keras changes. As part of this changes, we will also move our off any private, unexported symbols (no more keras_core.src). * Fixes for whisper
Currently this is only available via github.
Eventually this will be available via
pip install keras
.We need it now to support testing against the latest keras changes.
As part of this changes, we will also move our off any private, unexported symbols (no more keras_core.src).