You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Readme.md 7.5 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. # MobileNetV3 Description
  2. MobileNetV3 is tuned to mobile phone CPUs through a combination of hardware- aware network architecture search (NAS) complemented by the NetAdapt algorithm and then subsequently improved through novel architecture advances.Nov 20, 2019.
  3. [Paper](https://arxiv.org/pdf/1905.02244) Howard, Andrew, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingxing Tan, Weijun Wang et al. "Searching for mobilenetv3." In Proceedings of the IEEE International Conference on Computer Vision, pp. 1314-1324. 2019.
  4. # Model architecture
  5. The overall network architecture of MobileNetV3 is show below:
  6. [Link](https://arxiv.org/pdf/1905.02244)
  7. # Dataset
  8. Dataset used: [imagenet](http://www.image-net.org/)
  9. - Dataset size: ~125G, 1.2W colorful images in 1000 classes
  10. - Train: 120G, 1.2W images
  11. - Test: 5G, 50000 images
  12. - Data format: RGB images.
  13. - Note: Data will be processed in src/dataset.py
  14. # Features
  15. # Environment Requirements
  16. - Hardware(Ascend/GPU)
  17. - Prepare hardware environment with Ascend or GPU processor. If you want to try Ascend , please send the [application form](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/file/other/Ascend%20Model%20Zoo%E4%BD%93%E9%AA%8C%E8%B5%84%E6%BA%90%E7%94%B3%E8%AF%B7%E8%A1%A8.docx) to ascend@huawei.com. Once approved, you can get the resources.
  18. - Framework
  19. - [MindSpore](http://10.90.67.50/mindspore/archive/20200506/OpenSource/me_vm_x86/)
  20. - For more information, please check the resources below:
  21. - [MindSpore tutorials](https://www.mindspore.cn/tutorial/zh-CN/master/index.html)
  22. - [MindSpore API](https://www.mindspore.cn/api/zh-CN/master/index.html)
  23. # Script description
  24. ## Script and sample code
  25. ```python
  26. ├── MobilenetV3
  27. ├── Readme.md
  28. ├── scripts
  29. │ ├──run_train.sh
  30. │ ├──run_eval.sh
  31. ├── src
  32. │ ├──config.py
  33. │ ├──dataset.py
  34. │ ├──luanch.py
  35. │ ├──lr_generator.py
  36. │ ├──mobilenetV2.py
  37. ├── train.py
  38. ├── eval.py
  39. ```
  40. ## Training process
  41. ### Usage
  42. - Ascend: sh run_train.sh Ascend [DEVICE_NUM] [SERVER_IP(x.x.x.x)] [VISIABLE_DEVICES(0,1,2,3,4,5,6,7)] [DATASET_PATH]
  43. - GPU: sh run_trian.sh GPU [DEVICE_NUM] [VISIABLE_DEVICES(0,1,2,3,4,5,6,7)] [DATASET_PATH]
  44. ### Launch
  45. ```
  46. # training example
  47. Ascend: sh run_train.sh Ascend 8 192.168.0.1 0,1,2,3,4,5,6,7 ~/imagenet/train/
  48. GPU: sh run_train.sh GPU 8 0,1,2,3,4,5,6,7 ~/imagenet/train/
  49. ```
  50. ### Result
  51. Training result will be stored in the example path. Checkpoints will be stored at `. /checkpoint` by default, and training log will be redirected to `./train/train.log` like followings.
  52. ```
  53. epoch: [ 0/200], step:[ 624/ 625], loss:[5.258/5.258], time:[140412.236], lr:[0.100]
  54. epoch time: 140522.500, per step time: 224.836, avg loss: 5.258
  55. epoch: [ 1/200], step:[ 624/ 625], loss:[3.917/3.917], time:[138221.250], lr:[0.200]
  56. epoch time: 138331.250, per step time: 221.330, avg loss: 3.917
  57. ```
  58. ## Eval process
  59. ### Usage
  60. - Ascend: sh run_infer.sh Ascend [DATASET_PATH] [CHECKPOINT_PATH]
  61. - GPU: sh run_infer.sh GPU [DATASET_PATH] [CHECKPOINT_PATH]
  62. ### Launch
  63. ```
  64. # infer example
  65. Ascend: sh run_infer.sh Ascend ~/imagenet/val/ ~/train/mobilenet-200_625.ckpt
  66. GPU: sh run_infer.sh GPU ~/imagenet/val/ ~/train/mobilenet-200_625.ckpt
  67. ```
  68. > checkpoint can be produced in training process.
  69. ### Result
  70. Inference result will be stored in the example path, you can find result like the followings in `val.log`.
  71. ```
  72. result: {'acc': 0.71976314102564111} ckpt=/path/to/checkpoint/mobilenet-200_625.ckpt
  73. ```
  74. # Model description
  75. ## Performance
  76. ### Training Performance
  77. | Parameters | MobilenetV3 | |
  78. | -------------------------- | ---------------------------------------------------------- | ------------------------- |
  79. | Model Version | | large |
  80. | Resource | Ascend 910, cpu:2.60GHz 56cores, memory:314G | NV SMX2 V100-32G |
  81. | uploaded Date | 05/06/2020 | 05/06/2020 |
  82. | MindSpore Version | 0.3.0 | 0.3.0 |
  83. | Dataset | ImageNet | ImageNet |
  84. | Training Parameters | src/config.py | src/config.py |
  85. | Optimizer | Momentum | Momentum |
  86. | Loss Function | SoftmaxCrossEntropy | SoftmaxCrossEntropy |
  87. | outputs | | |
  88. | Loss | | 1.913 |
  89. | Accuracy | | ACC1[77.57%] ACC5[92.51%] |
  90. | Total time | | |
  91. | Params (M) | | |
  92. | Checkpoint for Fine tuning | | |
  93. | Model for inference | | |
  94. #### Inference Performance
  95. | Parameters | | | |
  96. | -------------------------- | ----------------------------- | ------------------------- | -------------------- |
  97. | Model Version | V1 | | |
  98. | Resource | Huawei 910 | NV SMX2 V100-32G | Huawei 310 |
  99. | uploaded Date | 05/06/2020 | 05/22/2020 | |
  100. | MindSpore Version | 0.2.0 | 0.2.0 | 0.2.0 |
  101. | Dataset | ImageNet, 1.2W | ImageNet, 1.2W | ImageNet, 1.2W |
  102. | batch_size | | 130(8P) | |
  103. | outputs | | | |
  104. | Accuracy | | ACC1[75.43%] ACC5[92.51%] | |
  105. | Speed | | | |
  106. | Total time | | | |
  107. | Model for inference | | | |
  108. # ModelZoo Homepage
  109. [Link](https://gitee.com/mindspore/mindspore/tree/master/mindspore/model_zoo)