c-yn / FocalNet

[ICCV23] Focal Network for Image Restoration
MIT License
52 stars 3 forks source link

About FLOPs #7

Closed zpc-666 closed 8 months ago

zpc-666 commented 8 months ago

Hello, I use thop.profile to calculate the FLOPs and Params of FocalNet. The results are 30.53G for FLOPs and 3.74M for Params. The FLOPs is different from that (30.63G) in your paper. Excuse me, how do you calculate FLOPs?

c-yn commented 8 months ago

Hi, we use ptflops to calculate FLOPs.

zpc-666 commented 8 months ago

Hi, we use ptflops to calculate FLOPs.

Thanks! But when I use ptflops.get_model_complexity_info(model, (3, 256, 256), as_strings=True, print_per_layer_stat=True), the FLOPs is 30.67GMac. Excuse me, did you overlook some of the modules?

c-yn commented 8 months ago

flops, _ = get_model_complexity_info(model, (3,256,256), as_strings=True, print_per_layer_stat=True, verbose=True) print('{:<30} {:<8}'.format('Computational complexity: ', flops))

Hi, we just directly use the reported FLOPs of ptflops. Can you obtain the same value as ours by using the above snipped?

zpc-666 commented 8 months ago

flops, _ = get_model_complexity_info(model, (3,256,256), as_strings=True, print_per_layer_stat=True, verbose=True) print('{:<30} {:<8}'.format('Computational complexity: ', flops))

Hi, we just directly use the reported FLOPs of ptflops. Can you obtain the same value as ours by using the above snipped?

The FLOPs is still 30.67GMac. Maybe it's because I use the latest version (0.7.2.1) of ptflops.