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 summary when optimizer is None #879

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

mattdangerw
Copy link
Member

Optimizer can be None (e.g. for just running inference). We should be careful not to assume it is always set when printing out model summary.

@mattdangerw mattdangerw requested review from qlzh727 and fchollet and removed request for qlzh727 September 13, 2023 21:28
@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (beba6f1) 76.49% compared to head (060560c) 76.49%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #879   +/-   ##
=======================================
  Coverage   76.49%   76.49%           
=======================================
  Files         329      329           
  Lines       31334    31334           
  Branches     6100     6100           
=======================================
  Hits        23970    23970           
  Misses       5785     5785           
  Partials     1579     1579           
Flag Coverage Δ
keras_core 76.40% <100.00%> (ø)

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

Files Changed Coverage Δ
keras_core/utils/summary_utils.py 72.72% <100.00%> (ø)

☔ 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, thanks for the fix!

@fchollet
Copy link
Member

FAILED keras_core/utils/summary_utils_test.py::SummaryUtilsTest::test_print_model_summary0 - NotImplementedError: fit not implemented for NumPy backend.

We should exclude the Numpy backend in the test.

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

@fchollet fchollet merged commit bb21710 into keras-team:main Sep 13, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants