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

Fix CompileLoss with undefined loss argument #20296

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

james77777778
Copy link
Contributor

Fix #20243

Actually, #20243 works as expected in torch and jax backends without this PR. The underlying issue in TF backend has been resolved.

The root cause was that we used pop in _filter_unused_inputs within CompileLoss, which is not allowed in a jitted tf graph. The solution is to avoid modifying the incoming data.

A test has been added to verify the implementation.

@codecov-commenter
Copy link

codecov-commenter commented Sep 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.84%. Comparing base (ef407db) to head (b9955ad).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #20296      +/-   ##
==========================================
+ Coverage   78.82%   78.84%   +0.01%     
==========================================
  Files         511      511              
  Lines       48974    48979       +5     
  Branches     9018     9019       +1     
==========================================
+ Hits        38605    38617      +12     
+ Misses       8505     8499       -6     
+ Partials     1864     1863       -1     
Flag Coverage Δ
keras 78.70% <100.00%> (+0.01%) ⬆️
keras-jax 62.30% <100.00%> (+0.01%) ⬆️
keras-numpy 57.44% <0.00%> (-0.01%) ⬇️
keras-tensorflow 63.58% <100.00%> (+0.01%) ⬆️
keras-torch 62.29% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you

@google-ml-butler google-ml-butler bot added kokoro:force-run ready to pull Ready to be merged into the codebase labels Sep 27, 2024
@fchollet fchollet merged commit 93cb954 into keras-team:master Sep 27, 2024
7 checks passed
@google-ml-butler google-ml-butler bot removed ready to pull Ready to be merged into the codebase kokoro:force-run labels Sep 27, 2024
@james77777778 james77777778 deleted the fix-compileloss branch September 28, 2024 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support for dictionary-type loss functions without explicitly declaring None
4 participants