Created
January 12, 2021 11:23
-
-
Save IAmSuyogJadhav/56e51900e3e1632dffd7767eb377d351 to your computer and use it in GitHub Desktop.
Count and display the total no. of parameters in a PyTorch model.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# model is your pytorch model (an nn.Module instance) | |
pytorch_total_params = sum(p.numel() for p in model.parameters()) | |
print(pytorch_total_params) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment