Skip to content

LayerSummary.input_size returns '?' #12827

Discussion options

You must be logged in to vote

when you do this:

model = SatNet.load_from_checkpoint("models\\newPLModelTest\\finalEpochSatnet.ckpt")

a new model is instantiated from scratch. Now since PyTorch modules are dynamic, they don't have input shape/output shape configured by default until a computation/forward pass is done through that layer when module is registered with LayerSummary. So you need to do a forward pass using a sample input to compute the required sizes. Check out the example linked in the docs.

https://pytorch-lightning.readthedocs.io/en/stable/api/pytorch_lightning.utilities.model_summary.html#pytorch_lightning.utilities.model_summary.LayerSummary

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ross-ca
Comment options

Answer selected by ross-ca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment