README.md 2.07 KB
Newer Older
sunxx1's avatar
sunxx1 committed
1
2
# Mobilenetv2

sunxx1's avatar
sunxx1 committed
3
4
5
6
7
8
## 论文

MobileNetV2: Inverted Residuals and Linear Bottlenecks

- https://openaccess.thecvf.com/content_cvpr_2018/papers/Sandler_MobileNetV2_Inverted_Residuals_CVPR_2018_paper.pdf

sunxx1's avatar
sunxx1 committed
9
10
11
12
## 模型介绍

MobileNetV2是一种轻量级的卷积神经网络模型,由Google在2018年提出。它是MobileNet系列中的第二个版本,主要用于移动设备和嵌入式设备等资源受限的环境中进行图像分类、目标检测等计算机视觉任务。

sunxx1's avatar
sunxx1 committed
13
![d15a0e56517b4f7284a862f1d6eaef9a](./images/d15a0e56517b4f7284a862f1d6eaef9a.png)
sunxx1's avatar
sunxx1 committed
14
15
16



sunxx1's avatar
sunxx1 committed
17
## 模型结构
sunxx1's avatar
sunxx1 committed
18

sunxx1's avatar
sunxx1 committed
19
MobileNetV2的网络结构主要由两部分组成:特征提取层和分类器。
sunxx1's avatar
sunxx1 committed
20

sunxx1's avatar
sunxx1 committed
21
![20231124104337](./images/20231124104337.png)
sunxx1's avatar
sunxx1 committed
22

sunxx1's avatar
sunxx1 committed
23
## 环境配置
sunxx1's avatar
sunxx1 committed
24

sunxx1's avatar
sunxx1 committed
25
### Docker
sunxx1's avatar
sunxx1 committed
26

sunxx1's avatar
sunxx1 committed
27
28
29
30
31
```python
git clone --recursive http://developer.hpccube.com/codes/modelzoo/mobilenetv2_mmcv.git
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:1.10.0-centos7.6-dtk-22.10.1-py37-latest
# <your IMAGE ID>用以上拉取的docker的镜像ID替换
docker run --shm-size 10g --network=host --name=nit-pytorch --privileged --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $PWD/Mobilenetv2_mmcv:/home/Mobilenetv2_mmcv -it <your IMAGE ID> bash
sunxx1's avatar
sunxx1 committed
32

sunxx1's avatar
sunxx1 committed
33
34
35
cd Mobilenetv2_mmcv/mmclassification-mmcv
pip install -r requirements.txt
```
sunxx1's avatar
sunxx1 committed
36

sunxx1's avatar
sunxx1 committed
37
## 数据集
sunxx1's avatar
sunxx1 committed
38

sunxx1's avatar
sunxx1 committed
39
40
41
42
43
44
45
在本测试中可以使用ImageNet数据集。

```
├── meta
├── train
├── val
```
sunxx1's avatar
sunxx1 committed
46
47
48
49
50

### 训练

将训练数据解压到data目录下。

sunxx1's avatar
sunxx1 committed
51
### 单机8卡
sunxx1's avatar
sunxx1 committed
52
53
54

    ./mobilenetv2.sh

sunxx1's avatar
sunxx1 committed
55
## 精度
sunxx1's avatar
sunxx1 committed
56
57
58

测试数据使用的是ImageNet数据集,使用的加速卡是DCU Z100L。

sunxx1's avatar
sunxx1 committed
59
60
61
62
| 卡数 |           精度            |
| :--: | :-----------------------: |
|  8   | top1:0.71764;top5:0.90386 |

sunxx1's avatar
sunxx1 committed
63
64
65
66
67
68
69
70
71
72
73
74
## result

![img](https://developer.hpccube.com/codes/modelzoo/vit_pytorch/-/raw/master/image/README/1695381570003.png)

## 应用场景

### 算法类别

图像分类

### 热点行业

sunxx1's avatar
sunxx1 committed
75
制造,能源,交通,网安
sunxx1's avatar
sunxx1 committed
76

sunxx1's avatar
sunxx1 committed
77
### 源码仓库及问题反馈
sunxx1's avatar
sunxx1 committed
78

sunxx1's avatar
sunxx1 committed
79
https://developer.hpccube.com/codes/modelzoo/mobilenetv2_mmcv
sunxx1's avatar
sunxx1 committed
80
81
82
83

### 参考

https://github.com/open-mmlab/mmpretrain