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

Loss functions applied in alphabetical order instead of by dictionary keys (since Keras 3.5.0) #4988

Open
malcolmlett opened this issue Dec 5, 2024 · 3 comments

Comments

@malcolmlett
Copy link

malcolmlett commented Dec 5, 2024

Current behavior
When training models with multiple outputs, and using dictionary as loss parameter to model.compile(), the wrong loss functions are applied against the different model outputs. The alphabetical order of the dictionary keys determines the order of loss function against model output.

Expected behavior
Loss functions should be applied against named model outputs.

Workaround
Bug is with Keras 3.5.0 (Google Colab's current default), and can be avoided by downgrading to Keras 3.4.1.

Additional context
Issue has been raised with Keras team: keras-team/keras#20596
Detailed instructions for replication are included there.

This present issue is for awareness of Colab team.

@malcolmlett malcolmlett added the bug label Dec 5, 2024
@cperry-goog
Copy link

This is a great bug report, thank you! I'll pass on to the Keras folks as well.

@malcolmlett
Copy link
Author

Update: I'd mistakenly typed Keras 2.5.0 and 2.4.1, when that should have been 3.5.0 / 3.4.1 -- have updated the description.

Also, Keras folks say that Keras 3.7.0 works ok. What does that mean for Google Colab and its current 3.5.0 default?

@colaboratory-team
Copy link
Contributor

Tracking internally as b/383879003, we will try to get Keras updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants