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

Any suggestions on how can I extend this code for MobileNetV2? #21

Open
nekulkarni opened this issue Sep 6, 2018 · 9 comments
Open

Comments

@nekulkarni
Copy link

The given example of VGG16 works well for me. I want to try out this method on a MobiletNetV2 model. VGG16 has a pretty simple structure: a sequence of convs and other layers. However, MobiletNetV2 has a peculiar structure contains InvertedResidualBlocks, which is making the extension hard for me.

Any suggestions?

@aprams
Copy link

aprams commented Sep 29, 2018

Did you find a solution to this?

@nekulkarni
Copy link
Author

nekulkarni commented Oct 20, 2018

@aprams Yes I did, had to do multiple changes to make that work. I basically flattened the mobilenetv2 model into a flat model before feeding into this code (dealing with the residual links is the trickiest part in the flattening process). Secondly, I changed prune.py significantly to address batchnorm layers, and depthwise convs. I hope that helps.

@NCHW
Copy link

NCHW commented Nov 30, 2018

@nekulkarni Can you share me your code,please? I need to prune the mobilenetv2 for the school project but I am the beginner for python.

@viviov
Copy link

viviov commented Dec 18, 2018

@aprams Yes I did, had to do multiple changes to make that work. I basically flattened the mobilenetv2 model into a flat model before feeding into this code (dealing with the residual links is the trickiest part in the flattening process). Secondly, I changed prune.py significantly to address batchnorm layers, and depthwise convs. I hope that helps.

Thanks for sharing, could you please share more about how to deal with batchnorm layers? Thanks so much.

@CF2220160244
Copy link

@nekulkarni , I have pruned mobilenetv2 correctly, but the pruned model is difficult to train on imagenet, the accuracy is very low( I train with a 1080Ti, batchsize=96, lr=0.045, weight decay=0.00004, and decrease the lr 0.98 for each epoch, and i also try lr =0.1, lr = lr * (0.1 ** (epoch // 30)) ). can you tell me your data set and accuracy.
thank you very much!

@CF2220160244
Copy link

It seems that mobilenetv2 convergence slowly !

@guanhuiyan
Copy link

@nekulkarni Can you share me your code about mobilenetv2 pruned ,please? I am a beginner. Thank you very much!

@guanhuiyan
Copy link

@viviov Can you share me your code about mobilenetv2 pruned ,please? I am a beginner. Thank you very much!

@bharat3012
Copy link

@nekulkarni Can you share the code with me also? I want to know how to deal with batch norm layers. Thank you very much.!!

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

7 participants