Skip to content

Discrepancy in MobileFaceNet FLOPs: Reported 450M vs. Measured 233M #4

Description

@muyouhang

I tested the parameters and FLOPs using this code:

https://github.com/fdbtrs/AdaDistill/blob/main/backbones/mobilefacenet.py

The computation code is as follows:

from ptflops import get_model_complexity_info backbone = MobileFaceNet([112,112]) data = torch.zeros([1,3,112,112]) backbone.eval() T1 = time.time() feature = backbone(data) T2 = time.time() macs, params = get_model_complexity_info(backbone, (3, 112, 112), as_strings=True, print_per_layer_stat=False, verbose=False) log = '' log+= '{} {}'.format('Params: ', params) log+= '\t{} {}'.format('FLOPs: ', macs) log+= '\toutput: {}'.format((np.squeeze(feature.detach().numpy())).shape) log+= '\tcost : %0.2f ms'%((T2 - T1) * 1000) print(log)

The result is :
Params: 1.2 M FLOPs: 233.09 MMac output: (512,) cost : 43.12 ms
However, the paper states in Section 4.3:

"We use MobileFaceNet [9] (1.19M parameters and 0.45 GFLOPs), noted as MFN, as the student."

I would appreciate it if the author could explain this discrepancy.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions