8000 Which library is used to calculate the model complexity ? · Issue #99 · Algolzw/daclip-uir · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Which library is used to calculate the model complexity ? #99

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

Open
supersonicMaclaurin opened this issue Feb 10, 2025 · 3 comments
Open

Comments

@supersonicMaclaurin
Copy link

I used the libraries thop and ptflops to measure the computational complexity. For ConditionalUNet with an input size of 256x256, the calculated amount of computation was 129.021558784G

@supersonicMaclaurin
Copy link
Author

Can you provide the code ?

@Algolzw
Copy link
Owner
Algolzw commented Feb 10, 2025

Hi! I use torchsummaryX and here is the code:

import argparse

import torch
from torchsummaryX import summary

import options as option
from models import create_model

parser = argparse.ArgumentParser()
parser.add_argument(
    "-opt",
    type=str,
    default="options/derain/test/test_sde_derain.yml",
    help="Path to option YMAL file of Predictor.",
)
args = parser.parse_args()
opt = option.parse(args.opt, is_train=False)

opt = option.dict_to_nonedict(opt)
model = create_model(opt)

test_tensor = torch.randn(1, 3, 256, 256).cuda()
summary(model.model, x=test_tensor)

@supersonicMaclaurin
Copy link
Author

tks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0