You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upgrading from TensorFlow 2.15 to 2.16 introduces inconsistencies due to the shift from Keras 2 to Keras 3. TensorFlow 2.15 uses Keras 2, while TensorFlow 2.16 integrates Keras 3. This change leads to significant differences in model behavior within this repository, which is built upon Keras 2. However, platforms like Google Colab and Kaggle notebooks already use Keras 3 by default.
Describe the bug
In Chapter 16, "Encoder-Decoder Network for Neural Machine Translation," the model achieves an accuracy of approximately 60% when using Keras 2, as documented in the repository. However, running the same code on Colab or Kaggle with Keras 3 results in an accuracy drop to around 10%.
For more details about this discrepancy, please refer to this issue.
Recommended Action
To maintain consistency and prevent unexpected issues, I recommend explicitly setting the environment variable TF_USE_LEGACY_KERAS=1 to continue using Keras 2.
The text was updated successfully, but these errors were encountered:
Lw-Cui
changed the title
[BUG] Recommend Setting TF_USE_LEGACY_KERAS=1 to Fix Accuracy Drop After Upgrading to Keras 3
[BUG] Recommend Setting TF_USE_LEGACY_KERAS=1 to Fix Behavior Change After Upgrading to Keras 3
Oct 3, 2024
Thanks for your suggestion, I was struggling to update this chapter to Keras 3, but it's pretty much impossible for now, because things like Stateful RNNs, ragged tensors, TF hub models, and more are buggy or just not supported yet. Using legacy Keras just works. 👍
Upgrading from TensorFlow 2.15 to 2.16 introduces inconsistencies due to the shift from Keras 2 to Keras 3. TensorFlow 2.15 uses Keras 2, while TensorFlow 2.16 integrates Keras 3. This change leads to significant differences in model behavior within this repository, which is built upon Keras 2. However, platforms like Google Colab and Kaggle notebooks already use Keras 3 by default.
Describe the bug
In Chapter 16, "Encoder-Decoder Network for Neural Machine Translation," the model achieves an accuracy of approximately 60% when using Keras 2, as documented in the repository. However, running the same code on Colab or Kaggle with Keras 3 results in an accuracy drop to around 10%.
For more details about this discrepancy, please refer to this issue.
Recommended Action
To maintain consistency and prevent unexpected issues, I recommend explicitly setting the environment variable
TF_USE_LEGACY_KERAS=1
to continue using Keras 2.The text was updated successfully, but these errors were encountered: