How to save model.summary() to file in Keras?

Viewed 20226
2 Answers

Here you have another option:

with open('modelsummary.txt', 'w') as f:

    model.summary(print_fn=lambda x: f.write(x + '\n'))
Related