-
Notifications
You must be signed in to change notification settings - Fork 19.5k
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
Does tensorflow < 2.16 depend on keras or tf-keras? #19069
Comments
You can install tensorflow 2.15 first, which installs keras 2.15, you can update the keras package again to upgrade it to latest version, which is From tensorflow 2.16, it will install keras 3 by default. Here is the commit for updating the requirement for tf-nightly(2.16) |
@sachinprasadhs Thanks!
What does it mean? tf-keras is a different package from keras, though they share the same version number. Now TF 2.15 is pointing to Keras instead of tf-keras. For more context, if I have both |
tensorflow 2.15 by default installs keras 2.15 here https://github.com/keras-team/keras/tree/v2.15.0 and it will point to keras 2 . If you install Keras 3 and if you also want the keras 2 behavior, then you can install tf-keras 2.15 and set the env variable with More details on this can be found here https://keras.io/getting_started/#tensorflow--keras-2-backwards-compatibility |
@sachinprasadhs Thanks! One more question, on keras.io it says: Should you want tf.keras to stay on Keras 2 after upgrading to TensorFlow 2.16+, you can configure your TensorFlow installation so that tf.keras points to tf_keras. To achieve this: Does this |
Ideally you don't need to use |
@sachinprasadhs Thanks! One more question - why should there be an error message |
I guess it is because of all the dependency in the same requirement.txt file. If that is the case, try installing keras separately else you may find below error.
|
This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you. |
This issue was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further. |
I have tried to ignore keras when installing Object detection and other Api's for version incompatibility and other issues, and after installation, I have seen that tasks include tensorflow and keras both, it doesn't works If keras wasn't installed properly with version control. And you can change keras version any time, where tf.keras will not help you in that case. So most of the installation and code will not work if Keras isn't installed independently. |
I will suggest to install keras 2.15.0 when you are installing any api or proto, after installation, install the latest any version you need, like 3.1.1 is latest. then older version will be auto replaced. |
Hi team,
I have a question about Keras dependency of installing Tensorflow < 2.16. Basically if I run
pip install tensorflow==2.15.0
, it's going to installkeras==2.15
as a dependency. Then when I upgrade tokeras==3.0.2
, it throws an error:I was assuming older Tensorflow version will port to
tf-keras
instead ofkeras
, but after I dopip install tf-keras
, thenfrom tensorflow import keras
, thekeras
is still the multi-backend Keras. Could you help clarify the dependency? Will old tensorflow point to tf-keras?For some context, I am trying to add
keras 3
support to MLflow: mlflow/mlflow#10830, and the CI is failing because of incompatibility between Tensorflow version and Keras version. Thanks!Best,
chenmoney
The text was updated successfully, but these errors were encountered: