How do I check the number of parameters of a model?

For finding the total number of parameter elements (if you are interested in the total size of the parameter space rather than the number of parameter tensors), I use sum(p.numel() for p in model.parameters())

1 Like