Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to calculate the number of parameters and computational complexity for each model #902

Open
wangluoWSG opened this issue Aug 2, 2024 · 1 comment
Labels
question Information

Comments

@wangluoWSG
Copy link

Hello, I want to calculate the number of parameters and computational complexity for each model (like U-Net, U-Net++, etc.). How can I implement this?

@qubvel
Copy link
Collaborator

qubvel commented Aug 2, 2024

Hi @wangluoWSG

The number of parameters could be computed with

num_params = sum(p.numel() for p in model.parameters())

To compute model FLOPs you can try the following tools

@qubvel qubvel added the question Information label Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Information
Projects
None yet
Development

No branches or pull requests

2 participants