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

The flops and parameters of NASFPN is not matched #6336

Closed
lucienne999 opened this issue Oct 21, 2021 · 4 comments
Closed

The flops and parameters of NASFPN is not matched #6336

lucienne999 opened this issue Oct 21, 2021 · 4 comments
Assignees

Comments

@lucienne999
Copy link

lucienne999 commented Oct 21, 2021

Hi, table.1 in [1] show that NAS-FPN R-50 (7 @ 256) FLops and parameters is 281.3B , 60.3 M. However, I use get_flops.py to get 140.42 GF and 68.02M when using NasFPN config.

Refer:
[1] https://arxiv.org/pdf/1904.07392.pdf

@lucienne999
Copy link
Author

lucienne999 commented Oct 21, 2021

The config i use: configs/nas_fpn/retinanet_r50_nasfpn_crop640_50e_coco.py
The code i run python tools/analysis_tools/get_flops.py configs/nas_fpn/retinanet_r50_naspredfpn_crop512_10e_coco_NasFPN.py --shape 640 640

I think it is ok with a slight difference. But it looks unreasonable?

@RangiLyu
Copy link
Member

These are two different meanings of FLOPs. In some papers, FLOPs means floating-point operations, and it including mul and add. But in some other papers, a multiply-add counts as one flop.
In mmdet, we use https://github.com/sovrasov/flops-counter.pytorch
And there is a related issue: sovrasov/flops-counter.pytorch#40

@lucienne999
Copy link
Author

@RangiLyu Thanks for your reply. But how to explain the difference in parameters?

@lucienne999
Copy link
Author

lucienne999 commented Oct 21, 2021

I found that the difference in parameters came from the implementation. The difference in flops because nasfpn uses another calculation mentioned by RangiLyu.

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

No branches or pull requests

2 participants