Closed
Description
When printing a model summary non-interactively, the provided line_width
is not honored, resulting in right-side truncation in the file context. The rich table's default of 80 seems to be used instead.
Changing:
keras/keras/src/utils/summary_utils.py
Line 353 in 6d26efb
Locally, if I set width
to line_width
, it produces the expected file contents:
highlight=False, force_terminal=False, color_system=None, width=line_length
Example of non-interactive model printing with line_length > 80:
with open(summary_path, 'w') as f:
model.summary(expand_nested=True, show_trainable=True, line_length=120,
print_fn=lambda x: f.write(x + '\n'))