Keras v3 question

If I use TF version greater than or equal to V2.16, does it mean I will automatically use Keras v3? Will there be any compatibility issues?

What is the best practice for going forward? Do I use “import keras” or continue to use tf.keras?

Hi @kdlin1

Yes, Starting with TensorFlow 2.16 using pip install tensorflow will automatically install Keras 3. So, when you have TF >= 2.16 and Keras 3, then by default from tensorflow import keras (tf.keras) will be Keras 3 as mentioned in this document.

You can consider using Keras 3 directly with import keras if you want backend flexibility and the latest Keras features.
Please refer the above attached document for more detailed understanding in this.

Hope this helps! Thank You.

1 Like