total = sum([param.nelement() for param in model.parameters()])
print("Number of parameter: %.2fM" % (total/1e6))
pytorch calculates the amount of model parameters
Guess you like
Origin blog.csdn.net/weixin_43486780/article/details/114690332
Recommended
Ranking