-
Notifications
You must be signed in to change notification settings - Fork 19.6k
fix csv logger bug #21332
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 csv logger bug #21332
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21332 +/- ##
==========================================
- Coverage 82.65% 82.65% -0.01%
==========================================
Files 565 565
Lines 54815 54821 +6
Branches 8511 8513 +2
==========================================
+ Hits 45310 45313 +3
- Misses 7413 7414 +1
- Partials 2092 2094 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
keras/src/callbacks/csv_logger.py
Outdated
self.keys.extend(["val_" + k for k in self.keys]) | ||
|
||
# Check if the model is expected to produce validation metrics. | ||
if hasattr(self.model, "metrics_names"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: you don't need if hasattr(self.model, "metrics_names"):
, it's a property on the Model
class:
https://github.com/keras-team/keras/blob/master/keras/src/trainers/trainer.py#L271
fixes the issue about
CSVLogger is setting val_* metrics to nan despite no validation data being provided
: #21173Colab to verify : https://colab.sandbox.google.com/drive/1tZmeU2x_DpB6q5hBtsg2pGTR4KhqK2_7#scrollTo=RtemKVh36rI6
The values to be matched between progbar and cvs logger is fixed in #21331