README.md 3.11 KB
Newer Older
dcuai's avatar
dcuai committed
1
# ShuffleNetV2
Sugon_ldc's avatar
Sugon_ldc committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

## 论文
- https://arxiv.org/abs/1807.11164
## 模型结构
ShuffleNetV2是一种轻量级卷积神经网络,其核心结构包括逐通道卷积、分组卷积、通道混洗操作以及特殊的残差连接结构,通过这些设计在减少计算量和参数量的同时,有效提升了模型的性能和效率,特别适用于移动设备等资源受限的场景。

![model](model.png)


## 算法原理
ShuffleNetV2通过逐通道卷积降低计算量,利用分组卷积和通道混洗操作减少信息损失并增强特征融合,同时采用合适的残差连接设计,实现高效且性能优异的轻量级网络架构。

![model2](model2.png)


## 环境配置
### Docker(方法一)
此处提供[光源](https://www.sourcefind.cn/#/service-details)拉取docker镜像的地址与使用步骤
```
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.1.0-py3.10-dtk24.04.3-ubuntu20.04

docker run -it --name docker_name -v /path/your_code_data/:/path/your_code_data/ -v /opt/hyhal:/opt/hyhal:ro --network=host --shm-size=32G --privileged=true --device=/dev/kfd --ipc=host --device=/dev/dri/ --group-add video image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.1.0-py3.10-dtk24.04.3-ubuntu20.04 /bin/bash
```
### Dockerfile(方法二)
此处提供dockerfile的使用方法
```
cd ./docker
docker build --no-cache -t shufflenetv2:1.0 .
docker run -it -v /path/your_code_data/:/path/your_code_data/ --shm-size=32G --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video --name docker_name imageID /bin/bash
```
### Anaconda(方法三)
此处提供本地配置、编译的详细步骤,例如:

chenzk's avatar
chenzk committed
35
关于本项目DCU显卡所需的特殊深度学习库可从[光合](https://developer.sourcefind.cn/tool/)开发者社区下载安装。
Sugon_ldc's avatar
Sugon_ldc committed
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
```
DTK驱动:dtk24.04.3
python:python3.10
torch:2.1.0
torchvision:0.16.0
```
`Tips:以上dtk驱动、python、paddle等DCU相关工具版本需要严格一一对应`


## 数据集
`s2数据集`

训练所用的数据集在/data/目录下



## 训练
一般情况下,ModelZoo上的项目提供单机训练的启动方法即可,单机多卡、单机单卡至少提供其一训练方法。
### 单机多卡
```
python -m torch.distributed.launch --nproc_per_node=8 ShuffleNetV2Driver_multi.py 
```

### 单机单卡
```
python ShuffleNetV2Driver.py
```


## result

chenzk's avatar
chenzk committed
67
![img](https://developer.sourcefind.cn/codes/modelzoo/vit_pytorch/-/raw/master/image/README/1695381570003.png)
Sugon_ldc's avatar
Sugon_ldc committed
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92



### 精度
测试数据:/data/下的s2数据集,使用的加速卡:K100_AI。

根据测试结果情况填写表格:
| 卡数 | 精度 |
| :------: | :------: |
| 8 | 0.8666 |
## 应用场景
### 算法类别
`图像分类`

### 热点应用行业
应用行业的填写需要做大量调研,从而为使用者提供专业、全面的推荐,除特殊算法,通常推荐数量>=3。

`制造,能源,交通,网安,安防`

## 预训练权重
- 该工程为通用训练模型,不需要预训练权重文件
## 源码仓库及问题反馈
- https://developer.sourcefind.cn/codes/modelzoo/shufflenet_v2_pytorch
## 参考资料
- https://github.com/Randl/ShuffleNetV2-pytorch