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

Save the model summary #164

Open
arielsolomon opened this issue Feb 25, 2021 · 1 comment
Open

Save the model summary #164

arielsolomon opened this issue Feb 25, 2021 · 1 comment

Comments

@arielsolomon
Copy link

Hi,
How can I save the model summary output to variable? text file? print to file?

@cainmagi
Copy link

The current version could support your need. Please use the newest GitHub version instead of the version installed by PyPI, because torchsummary.summary_string does not exist in torchsummary 1.5.1.

Here is an example:

import torchsummary
module = ... # Get my torch.nn.Module
with open('my_module_log.log', 'w') as f:
    report, _ = torchsummary.summary_string(model, ...)
    f.write(report)

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

No branches or pull requests

2 participants