README.md 2.15 KB
Newer Older
sunxx1's avatar
sunxx1 committed
1
# VGG16
sunxx1's avatar
sunxx1 committed
2

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

VERY DEEP CONVOLUTIONAL NETWORKS FOR LARGE-SCALE IMAGE RECOGNITION

- https://arxiv.org/abs/1409.1556

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

sunxx1's avatar
sunxx1 committed
11
VGG模型是2014年ILSVRC竞赛的第二名,第一名是GoogLeNet。但是VGG模型在多个迁移学习任务中的表现要优于GoogLeNet。而且,从图像中提取CNN特征,VGG模型是首选算法。
sunxx1's avatar
sunxx1 committed
12

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

sunxx1's avatar
sunxx1 committed
15
16
## 模型结构

sunxx1's avatar
sunxx1 committed
17
VGG16共有16个层,是一个相当深的卷积神经网络。VGG各种级别的结构都采用了5段卷积,每一段有一个或多个卷积层。
sunxx1's avatar
sunxx1 committed
18

sunxx1's avatar
sunxx1 committed
19
![20231124132925](./images/20231124132925.png)
sunxx1's avatar
sunxx1 committed
20

sunxx1's avatar
sunxx1 committed
21
## 环境配置
sunxx1's avatar
sunxx1 committed
22

sunxx1's avatar
sunxx1 committed
23
### Docker
sunxx1's avatar
sunxx1 committed
24

sunxx1's avatar
sunxx1 committed
25
26
27
28
```python
git clone --recursive http://developer.hpccube.com/codes/modelzoo/vgg16_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替换
sunxx1's avatar
sunxx1 committed
29
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/vgg16_mmcv:/home/vgg16_mmcv -it <your IMAGE ID> bash
sunxx1's avatar
sunxx1 committed
30

sunxx1's avatar
sunxx1 committed
31
32
33
cd VGG16_mmcv/mmclassification-mmcv
pip install -r requirements.txt
```
sunxx1's avatar
sunxx1 committed
34

sunxx1's avatar
sunxx1 committed
35
## 数据集
sunxx1's avatar
sunxx1 committed
36

sunxx1's avatar
sunxx1 committed
37
在本测试中可以使用ImageNet数据集。
sunxx1's avatar
sunxx1 committed
38

sunxx1's avatar
sunxx1 committed
39
40
41
42
下载ImageNet数据集:https://image-net.org/

下载val数据:链接:https://pan.baidu.com/s/1oXsmsYahGVG3uOZ8e535LA?pwd=c3bc 提取码:c3bc 替换ImageNet数据集中的val目录,处理后的数据结构如下:

sunxx1's avatar
sunxx1 committed
43
44
45
46
47
```
├── meta
├── train
├── val
```
sunxx1's avatar
sunxx1 committed
48
49
50
51
52

### 训练

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

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

sunxx1's avatar
sunxx1 committed
55
    ./vgg16.sh
sunxx1's avatar
sunxx1 committed
56

sunxx1's avatar
sunxx1 committed
57
## 精度
sunxx1's avatar
sunxx1 committed
58
59
60

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

sunxx1's avatar
sunxx1 committed
61
62
63
64
| 卡数 |          精度           |
| :--: | :---------------------: |
|  8   | top1:0.7162;top5:0.9049 |

sunxx1's avatar
sunxx1 committed
65
66
67
68
69
70
71
72
73
74
75
76
77
78
## result

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

## 应用场景

### 算法类别

图像分类

### 热点行业

制造,能源,交通,网安

sunxx1's avatar
sunxx1 committed
79
### 源码仓库及问题反馈
sunxx1's avatar
sunxx1 committed
80

sunxx1's avatar
sunxx1 committed
81
https://developer.hpccube.com/codes/modelzoo/vgg16_mmcv
sunxx1's avatar
sunxx1 committed
82
83
84
85

### 参考

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