Lightning-AI / pytorch-lightning

Pretrain, finetune ANY AI model of ANY size on multiple GPUs, TPUs with zero code changes.
https://lightning.ai
Apache License 2.0
28.47k stars 3.39k forks source link

How do I print the model summary if .fit() is not called #14487

Closed Felonious-Spellfire closed 2 years ago

Felonious-Spellfire commented 2 years ago

📚 Documentation

QUESTION

Sam

Is there a way to print the model summary if .fit() is not called? I’m only calling .predict() but it’d still be useful to see the summary


If you enjoy Lightning, check out our other projects! âš¡

cc @Felonious-Spellfire @akihironitta

rohitgr7 commented 2 years ago
from pytorch_lightning.utilities.model_summary import ModelSummary
model = LitModel()
summary = ModelSummary(model, max_depth=-1)
print(summary)