Skip to content

模型参数计算 #5

Description

@cyinen

模型参数计算

num_param = sum(p.numel() for p in model.parameters() if p.requires_grad) / 1e6

num_total_param = sum(p.numel() for p in model.parameters()) / 1e6

print('Number of total parameters: {} M, tunable parameters: {} M'.format(num_total_param, num_param))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions