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

Order of arguments to InvertedResidualBlock ('expand' and 'repeats' swapped) #1

Open
joseph-sch opened this issue Dec 3, 2019 · 0 comments

Comments

@joseph-sch
Copy link

joseph-sch commented Dec 3, 2019

Hi, Thank you for posting your code.

You have swapped the expand and repeats arguments in the calls to InvertedResidualBlock function.

The signature is:

def InvertedResidualBlock(x, expand, out_channels, repeats, stride, weight_decay, block_id):
(x, expand, out_channels, repeats, stride, weight_decay, block_id)

But when you call you wrote the repeats argument in place of the expand argument and conversely:

    x = InvertedResidualBlock(x, 5, 64, 2, (2, 2), weight_decay, 1)
    x = InvertedResidualBlock(x, 1, 128, 4, (2, 2), weight_decay, 2)
    x = InvertedResidualBlock(x, 6, 128, 2, (1, 1), weight_decay, 3)
    x = InvertedResidualBlock(x, 1, 128, 4, (2, 2), weight_decay, 4)
    x = InvertedResidualBlock(x, 2, 128, 2, (1, 1), weight_decay, 5)

It should be:

```python
    x = InvertedResidualBlock(x, 2, 64, 5, (2, 2), weight_decay, 1)
    x = InvertedResidualBlock(x, 4, 128, 1, (2, 2), weight_decay, 2)
    x = InvertedResidualBlock(x, 2, 128, 6, (1, 1), weight_decay, 3)
    x = InvertedResidualBlock(x, 4, 128, 1, (2, 2), weight_decay, 4)
    x = InvertedResidualBlock(x, 2, 128, 2, (1, 1), weight_decay, 5)

Here is the table from MobileFaceNets: Efficient CNNs for Accurate Real-Time Face Verification on Mobile Devices

mobilefacenet_table2_highlighted

joseph-sch referenced this issue in joseph-sch/Mobilefacenet Dec 3, 2019
Restored the correct order of the arguments in the calls to `InvertedResidualBlock`
@joseph-sch joseph-sch changed the title Order of arguments to Order of arguments to InvertedResidualBlock Dec 8, 2019
@joseph-sch joseph-sch changed the title Order of arguments to InvertedResidualBlock Order of arguments to InvertedResidualBlock ('expand' and 'repeats' swapped) Dec 8, 2019
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

1 participant