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

MobileNetv2 enchancement #14

Open
lucasjinreal opened this issue Nov 7, 2018 · 5 comments
Open

MobileNetv2 enchancement #14

lucasjinreal opened this issue Nov 7, 2018 · 5 comments

Comments

@lucasjinreal
Copy link

Thanks for sharing this wonderful project, however, I just wonder if there is any plan to add support of mobilenetv2 backend support SSD? if so, I can provide you a simple MobileNetv2 net scripts in pytorch.

@qfgaohao
Copy link
Owner

qfgaohao commented Nov 7, 2018

Thanks @jinfagang . I had a brief look at your implementation. They are very impressive! I am happy to integrate. Have you got some benchmark results of your MobileNetv2 or SSD models? So we can quickly get started.

Btw, there is a hacky mobilenetV2 SSD Lite impl https://github.com/qfgaohao/pytorch-ssd/blob/squeezenet-ssd-lite/vision/ssd/mobilenet_v2_ssd_lite.py . The problem I am facing is that ONNX doesn't support Relu6 used in Mobilenetv2. I replaced it with Relu. Currently I am training MobileNetv2 Imagenet Models.

I assume the ONNX Relu6 problem will resolve over time.

@lucasjinreal
Copy link
Author

@qfgaohao That is the question, I just borrowed some codes from others, change it into pytorch 0.41 fully supported, but after I test it, just not got any results (seems the whole process of SSD was broken).
But the backends that MobilenetV2 works fine.

theoretically, mobilenetv2 should be faster than mobilenetv1 backend, at least should be more accurate.

Now that you already training MobileNetV2 on imagenet, I can help you training on other datasets.

I think ReLu6 should not be the problem, if ONNX not support it now, we can just skip it at now time, hopefully ONNX will support it in the near future

@qfgaohao
Copy link
Owner

qfgaohao commented Nov 8, 2018

Hi @jinfagang you are right, we can safely skip Relu6. I will merge the code next week. I will let you how it goes.

@lucasjinreal
Copy link
Author

@qfgaohao Sounds great! Waiting for you response!

@qfgaohao
Copy link
Owner

@jinfagang Sorry for the delay. I was occupied by an urgent project. Plz see the trained MobleNetV2 SSD-Lite model with mp 0.686. https://storage.googleapis.com/models-hao/mb2-ssd-lite-mp-0_686.pth .

I have merged the code into the master branch. Here is code is reproduce the model.

wget -P models https://storage.googleapis.com/models-hao/mb2-imagenet-71_8.pth
python train_ssd.py --dataset_type voc  --datasets ~/data/VOC0712/VOC2007 ~/data/VOC0712/VOC2012 --validation_dataset ~/data/VOC0712/test/VOC2007/ --net mb2-ssd-lite --base_net models/mb2-imagenet-71_8.pth  --scheduler cosine --lr 0.01 --t_max 200 --validation_epochs 5 --num_epochs 20

I haven't got a MobileNetV2 with Relu base net having a reasonable accuracy. So the above model is based on the original MobileNetV2. The pre-trained base net is from https://github.com/tonylins/pytorch-mobilenet-v2

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

2 participants