#170 · Primary category: MLOps & Evaluation

pytorch-summary

deep-learning keras pytorch summary

Model summary in PyTorch similar to `model.summary()` in Keras

Project last updated:03/02/24

GitHub Stars

4.1K

Forks

409

Contributors

11

License

MIT

Why we included this project

Getting a clear picture of a PyTorch model from print(model) is a chore, and it tells you little about memory use. This utility prints a Keras-style summary instead: a layer-by-layer table with output shapes and parameter counts, along with estimates for input size and forward/backward pass size. Shape mismatches between modules become obvious at a glance, and the memory figures help you judge how large a batch your GPU can hold. The author has since pointed users to torchinfo as the maintained successor, so this repo is best treated as the lightweight original and a fast way to understand how the approach works. For older PyTorch code, or when you want one function and no extra dependencies, it still slots in easily.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category