Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
9e306e6e
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9e306e6e
编写于
1月 17, 2020
作者:
C
ceci3
提交者:
qingqing01
1月 17, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add latency demo for blazeface (#182)
* Add latency table * Add latency demo * Update doc
上级
1e395f8a
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
665 addition
and
11 deletion
+665
-11
slim/nas/README.md
slim/nas/README.md
+13
-4
slim/nas/blazeface.yml
slim/nas/blazeface.yml
+10
-2
slim/nas/latency_855.txt
slim/nas/latency_855.txt
+596
-0
slim/nas/train_nas.py
slim/nas/train_nas.py
+46
-5
未找到文件。
slim/nas/README.md
浏览文件 @
9e306e6e
...
...
@@ -5,7 +5,9 @@
## 概述
我们选取人脸检测的BlazeFace模型作为神经网络搜索示例,该示例使用
[
PaddleSlim
](
https://github.com/PaddlePaddle/PaddleSlim
)
辅助完成神经网络搜索实验,具体技术细节,请您参考
[
神经网络搜索策略
](
https://github.com/PaddlePaddle/PaddleSlim/blob/develop/docs/docs/tutorials/nas_demo.md
)
。
辅助完成神经网络搜索实验,具体技术细节,请您参考
[
神经网络搜索策略
](
https://github.com/PaddlePaddle/PaddleSlim/blob/develop/docs/docs/tutorials/nas_demo.md
)
。
<br>
基于PaddleSlim进行搜索实验过程中,搜索限制条件可以选择是浮点运算数(FLOPs)限制还是硬件延时(latency)限制,硬件延时限制需要提供延时表。本示例提供一份基于blazeface搜索空间的硬件延时表,名称是latency_855.txt(基于PaddleLite在骁龙855上测试的延时),可以直接用该表进行blazeface的硬件延时搜索实验。
<br>
硬件延时表每个字段的含义可以参考:
[
硬件延时表说明
](
https://github.com/PaddlePaddle/PaddleSlim/blob/develop/docs/docs/table_latency.md
)
## 定义搜索空间
...
...
@@ -15,9 +17,9 @@
-
单blaze模块
`blaze_filter_num2`
: 定义了BlazeFace单blaze模块中通道数变化区间,人为定义了适中的通道数区间;
-
过渡blaze模块
`mid_filter_num`
:定义了BlazeFace由单blaze模块到双blaze模块的过渡区间;
-
双blaze模块
`double_filter_num`
:定义了BlazeFace双blaze模块中通道数变化区间,人为定义了较大的通道数区间;
-
卷积核尺寸
`use_5x5kernel`
:定义了BlazeFace中卷积和尺寸大小是3x3或者5x5。
-
卷积核尺寸
`use_5x5kernel`
:定义了BlazeFace中卷积和尺寸大小是3x3或者5x5。
由于提供的延时表中只统计了3x3卷积的延时,所以启动硬件延时搜索实验时,需要把卷积核尺寸固定为3x3。
根据定义的搜索空间各个区间,我们的搜索空间tokens共9位,变化区间在([0, 0, 0, 0, 0, 0, 0, 0, 0], [7, 9, 12, 12, 6, 6, 6, 6, 2])范围内。
根据定义的搜索空间各个区间,我们的搜索空间tokens共9位,变化区间在([0, 0, 0, 0, 0, 0, 0, 0, 0], [7, 9, 12, 12, 6, 6, 6, 6, 2])范围内。
硬件延时搜索实验时,token的变化区间在([0, 0, 0, 0, 0, 0, 0, 0, 0], [7, 9, 12, 12, 6, 6, 6, 6, 1])范围内。
9位tokens分别表示:
...
...
@@ -46,7 +48,14 @@ blaze_filters与double_blaze_filters字段请参考[blazenet.py](../../ppdet/mod
## 开始搜索
首先需要安装PaddleSlim,请参考
[
安装教程
](
https://paddlepaddle.github.io/PaddleSlim/#_2
)
。
然后进入
`slim/nas`
目录中,修改blazeface.yml配置,配置文件中搜索配置字段含义请参考
[
NAS-API文档
](
https://github.com/PaddlePaddle/PaddleSlim/blob/develop/docs/docs/api/nas_api.md
)
,
然后进入
`slim/nas`
目录中,修改blazeface.yml配置,配置文件中搜索配置字段含义请参考
[
NAS-API文档
](
https://github.com/PaddlePaddle/PaddleSlim/blob/develop/docs/docs/api/nas_api.md
)
<br>
配置文件blazeface.yml中的
`Constraint`
字段表示当前搜索实验的搜索限制条件实例:
<br>
-
`ctype`
:具体的限制条件,可以设置为flops或者latency,分别表示浮点运算数限制和硬件延时限制。
-
`max_constraint`
:限制条件的最大值。
-
`min_constraint`
:限制条件的最小值。
-
`table_file`
:读取的硬件延时表文件的路径,这个字段只有在硬件延时搜索实验中才会用到。
然后开始搜索实验:
```
cd slim/nas
...
...
slim/nas/blazeface.yml
浏览文件 @
9e306e6e
...
...
@@ -8,16 +8,24 @@ save_dir: nas_checkpoint
# 1(label_class) + 1(background)
num_classes
:
2
# nas config
# nas config
start
reduce_rate
:
0.85
init_temperature
:
10.24
is_server
:
true
max_flops
:
531558400
search_steps
:
300
server_ip
:
"
"
server_port
:
8999
search_space
:
BlazeFaceNasSpace
Constraint
:
# choice: flops, latency
ctype
:
latency
max_constraint
:
57489
min_constraint
:
18000
# only need in latency search
table_file
:
latency_855.txt
# nas config end
LearningRate
:
base_lr
:
0.001
schedulers
:
...
...
slim/nas/latency_855.txt
0 → 100644
浏览文件 @
9e306e6e
op_type 855 us
conv,0,0,1,3,640,640,8,1,3,1,2,1 2433
conv,0,0,1,8,320,320,8,8,3,1,1,1 1053
conv,0,0,1,8,320,320,8,1,1,0,1,1 1462
conv,0,0,1,8,320,320,8,8,3,1,2,1 504
conv,0,0,1,8,160,160,48,1,1,0,1,1 1964
conv,0,0,1,48,160,160,48,48,3,1,1,1 1837
conv,0,0,1,48,160,160,48,1,1,0,1,1 3518
conv,0,0,1,48,160,160,48,48,3,1,2,1 860
conv,0,0,1,48,80,80,12,1,1,0,1,1 362
conv,0,0,1,12,80,80,12,12,3,1,1,1 92
conv,0,0,1,12,80,80,64,1,1,0,1,1 336
conv,0,0,1,48,80,80,64,1,1,0,1,1 1075
conv,0,0,1,64,80,80,64,64,3,1,1,1 381
conv,0,0,1,64,80,80,4,1,1,0,1,1 361
conv,0,0,1,4,80,80,4,4,3,1,1,1 55
conv,0,0,1,4,80,80,64,1,1,0,1,1 198
conv,0,0,1,64,80,80,64,64,3,1,2,1 217
conv,0,0,1,64,40,40,4,1,1,0,1,1 87
conv,0,0,1,4,40,40,4,4,3,1,1,1 42
conv,0,0,1,4,40,40,8,1,1,0,1,1 44
conv,0,0,1,64,40,40,8,1,1,0,1,1 102
conv,0,0,1,8,40,40,8,8,3,1,1,1 73
conv,0,0,1,8,40,40,4,1,1,0,1,1 45
conv,0,0,1,8,40,40,8,1,1,0,1,1 46
conv,0,0,1,8,40,40,12,1,1,0,1,1 53
conv,0,0,1,12,40,40,12,12,3,1,1,1 55
conv,0,0,1,12,40,40,8,1,1,0,1,1 50
conv,0,0,1,8,40,40,16,1,1,0,1,1 54
conv,0,0,1,16,40,40,16,16,3,1,1,1 59
conv,0,0,1,16,40,40,8,1,1,0,1,1 54
conv,0,0,1,8,40,40,20,1,1,0,1,1 63
conv,0,0,1,20,40,40,20,20,3,1,1,1 64
conv,0,0,1,20,40,40,8,1,1,0,1,1 58
conv,0,0,1,8,40,40,24,1,1,0,1,1 59
conv,0,0,1,24,40,40,24,24,3,1,1,1 69
conv,0,0,1,24,40,40,8,1,1,0,1,1 62
conv,0,0,1,8,40,40,32,1,1,0,1,1 69
conv,0,0,1,32,40,40,32,32,3,1,1,1 79
conv,0,0,1,32,40,40,8,1,1,0,1,1 70
conv,0,0,1,64,40,40,12,1,1,0,1,1 141
conv,0,0,1,64,40,40,16,1,1,0,1,1 143
conv,0,0,1,64,40,40,20,1,1,0,1,1 182
conv,0,0,1,64,40,40,24,1,1,0,1,1 179
conv,0,0,1,64,40,40,32,1,1,0,1,1 225
conv,0,0,1,4,40,40,12,1,1,0,1,1 48
conv,0,0,1,12,40,40,4,1,1,0,1,1 48
conv,0,0,1,12,40,40,12,1,1,0,1,1 59
conv,0,0,1,12,40,40,16,1,1,0,1,1 59
conv,0,0,1,16,40,40,12,1,1,0,1,1 66
conv,0,0,1,12,40,40,20,1,1,0,1,1 68
conv,0,0,1,20,40,40,12,1,1,0,1,1 71
conv,0,0,1,12,40,40,24,1,1,0,1,1 68
conv,0,0,1,24,40,40,12,1,1,0,1,1 77
conv,0,0,1,12,40,40,32,1,1,0,1,1 77
conv,0,0,1,32,40,40,12,1,1,0,1,1 90
conv,0,0,1,4,40,40,16,1,1,0,1,1 46
conv,0,0,1,16,40,40,4,1,1,0,1,1 55
conv,0,0,1,16,40,40,16,1,1,0,1,1 65
conv,0,0,1,16,40,40,20,1,1,0,1,1 83
conv,0,0,1,20,40,40,16,1,1,0,1,1 72
conv,0,0,1,16,40,40,24,1,1,0,1,1 75
conv,0,0,1,24,40,40,16,1,1,0,1,1 77
conv,0,0,1,16,40,40,32,1,1,0,1,1 90
conv,0,0,1,32,40,40,16,1,1,0,1,1 89
conv,0,0,1,4,40,40,24,1,1,0,1,1 51
conv,0,0,1,24,40,40,4,1,1,0,1,1 55
conv,0,0,1,24,40,40,20,1,1,0,1,1 95
conv,0,0,1,20,40,40,24,1,1,0,1,1 85
conv,0,0,1,24,40,40,24,1,1,0,1,1 93
conv,0,0,1,24,40,40,32,1,1,0,1,1 114
conv,0,0,1,32,40,40,24,1,1,0,1,1 113
conv,0,0,1,4,40,40,32,1,1,0,1,1 55
conv,0,0,1,32,40,40,4,1,1,0,1,1 63
conv,0,0,1,32,40,40,20,1,1,0,1,1 112
conv,0,0,1,20,40,40,32,1,1,0,1,1 98
conv,0,0,1,32,40,40,32,1,1,0,1,1 131
conv,0,0,1,4,40,40,40,1,1,0,1,1 59
conv,0,0,1,64,40,40,40,1,1,0,1,1 264
conv,0,0,1,40,40,40,40,40,3,1,1,1 89
conv,0,0,1,40,40,40,4,1,1,0,1,1 68
conv,0,0,1,40,40,40,8,1,1,0,1,1 78
conv,0,0,1,8,40,40,40,1,1,0,1,1 74
conv,0,0,1,40,40,40,12,1,1,0,1,1 100
conv,0,0,1,12,40,40,40,1,1,0,1,1 90
conv,0,0,1,40,40,40,16,1,1,0,1,1 103
conv,0,0,1,16,40,40,40,1,1,0,1,1 99
conv,0,0,1,40,40,40,20,1,1,0,1,1 128
conv,0,0,1,20,40,40,40,1,1,0,1,1 112
conv,0,0,1,40,40,40,24,1,1,0,1,1 129
conv,0,0,1,24,40,40,40,1,1,0,1,1 134
conv,0,0,1,40,40,40,32,1,1,0,1,1 154
conv,0,0,1,32,40,40,40,1,1,0,1,1 151
conv,0,0,1,4,40,40,48,1,1,0,1,1 68
conv,0,0,1,64,40,40,48,1,1,0,1,1 302
conv,0,0,1,48,40,40,48,48,3,1,1,1 99
conv,0,0,1,48,40,40,4,1,1,0,1,1 74
conv,0,0,1,48,40,40,8,1,1,0,1,1 84
conv,0,0,1,8,40,40,48,1,1,0,1,1 78
conv,0,0,1,48,40,40,12,1,1,0,1,1 114
conv,0,0,1,12,40,40,48,1,1,0,1,1 96
conv,0,0,1,48,40,40,16,1,1,0,1,1 114
conv,0,0,1,16,40,40,48,1,1,0,1,1 110
conv,0,0,1,48,40,40,20,1,1,0,1,1 147
conv,0,0,1,20,40,40,48,1,1,0,1,1 125
conv,0,0,1,48,40,40,24,1,1,0,1,1 147
conv,0,0,1,24,40,40,48,1,1,0,1,1 142
conv,0,0,1,48,40,40,32,1,1,0,1,1 175
conv,0,0,1,32,40,40,48,1,1,0,1,1 172
conv,0,0,1,4,40,40,64,1,1,0,1,1 73
conv,0,0,1,64,40,40,64,1,1,0,1,1 377
conv,0,0,1,64,40,40,64,64,3,1,1,1 137
conv,0,0,1,8,40,40,64,1,1,0,1,1 93
conv,0,0,1,12,40,40,64,1,1,0,1,1 113
conv,0,0,1,16,40,40,64,1,1,0,1,1 133
conv,0,0,1,20,40,40,64,1,1,0,1,1 155
conv,0,0,1,24,40,40,64,1,1,0,1,1 174
conv,0,0,1,32,40,40,64,1,1,0,1,1 213
conv,0,0,1,4,40,40,72,1,1,0,1,1 76
conv,0,0,1,64,40,40,72,1,1,0,1,1 414
conv,0,0,1,72,40,40,72,72,3,1,1,1 160
conv,0,0,1,72,40,40,4,1,1,0,1,1 121
conv,0,0,1,72,40,40,8,1,1,0,1,1 131
conv,0,0,1,8,40,40,72,1,1,0,1,1 102
conv,0,0,1,72,40,40,12,1,1,0,1,1 180
conv,0,0,1,12,40,40,72,1,1,0,1,1 120
conv,0,0,1,72,40,40,16,1,1,0,1,1 181
conv,0,0,1,16,40,40,72,1,1,0,1,1 162
conv,0,0,1,72,40,40,20,1,1,0,1,1 234
conv,0,0,1,20,40,40,72,1,1,0,1,1 167
conv,0,0,1,72,40,40,24,1,1,0,1,1 235
conv,0,0,1,24,40,40,72,1,1,0,1,1 190
conv,0,0,1,72,40,40,32,1,1,0,1,1 288
conv,0,0,1,32,40,40,72,1,1,0,1,1 234
conv,0,0,1,4,40,40,80,1,1,0,1,1 83
conv,0,0,1,64,40,40,80,1,1,0,1,1 457
conv,0,0,1,80,40,40,80,80,3,1,1,1 168
conv,0,0,1,80,40,40,4,1,1,0,1,1 124
conv,0,0,1,80,40,40,8,1,1,0,1,1 142
conv,0,0,1,8,40,40,80,1,1,0,1,1 105
conv,0,0,1,80,40,40,12,1,1,0,1,1 200
conv,0,0,1,12,40,40,80,1,1,0,1,1 131
conv,0,0,1,80,40,40,16,1,1,0,1,1 201
conv,0,0,1,16,40,40,80,1,1,0,1,1 156
conv,0,0,1,80,40,40,20,1,1,0,1,1 255
conv,0,0,1,20,40,40,80,1,1,0,1,1 179
conv,0,0,1,80,40,40,24,1,1,0,1,1 255
conv,0,0,1,24,40,40,80,1,1,0,1,1 207
conv,0,0,1,80,40,40,32,1,1,0,1,1 313
conv,0,0,1,32,40,40,80,1,1,0,1,1 255
conv,0,0,1,4,40,40,88,1,1,0,1,1 85
conv,0,0,1,64,40,40,88,1,1,0,1,1 491
conv,0,0,1,88,40,40,88,88,3,1,1,1 179
conv,0,0,1,88,40,40,4,1,1,0,1,1 133
conv,0,0,1,88,40,40,8,1,1,0,1,1 151
conv,0,0,1,8,40,40,88,1,1,0,1,1 113
conv,0,0,1,88,40,40,12,1,1,0,1,1 209
conv,0,0,1,12,40,40,88,1,1,0,1,1 142
conv,0,0,1,88,40,40,16,1,1,0,1,1 214
conv,0,0,1,16,40,40,88,1,1,0,1,1 167
conv,0,0,1,88,40,40,20,1,1,0,1,1 272
conv,0,0,1,20,40,40,88,1,1,0,1,1 192
conv,0,0,1,88,40,40,24,1,1,0,1,1 274
conv,0,0,1,24,40,40,88,1,1,0,1,1 224
conv,0,0,1,88,40,40,32,1,1,0,1,1 338
conv,0,0,1,32,40,40,88,1,1,0,1,1 274
conv,0,0,1,4,40,40,96,1,1,0,1,1 93
conv,0,0,1,64,40,40,96,1,1,0,1,1 535
conv,0,0,1,96,40,40,96,96,3,1,1,1 195
conv,0,0,1,96,40,40,4,1,1,0,1,1 157
conv,0,0,1,96,40,40,8,1,1,0,1,1 167
conv,0,0,1,8,40,40,96,1,1,0,1,1 119
conv,0,0,1,96,40,40,12,1,1,0,1,1 236
conv,0,0,1,12,40,40,96,1,1,0,1,1 147
conv,0,0,1,96,40,40,16,1,1,0,1,1 236
conv,0,0,1,16,40,40,96,1,1,0,1,1 196
conv,0,0,1,96,40,40,20,1,1,0,1,1 308
conv,0,0,1,20,40,40,96,1,1,0,1,1 207
conv,0,0,1,96,40,40,24,1,1,0,1,1 306
conv,0,0,1,24,40,40,96,1,1,0,1,1 237
conv,0,0,1,96,40,40,32,1,1,0,1,1 373
conv,0,0,1,32,40,40,96,1,1,0,1,1 295
conv,0,0,1,64,80,80,8,1,1,0,1,1 349
conv,0,0,1,8,80,80,8,8,3,1,1,1 74
conv,0,0,1,8,80,80,64,1,1,0,1,1 266
conv,0,0,1,64,80,80,12,1,1,0,1,1 512
conv,0,0,1,64,80,80,16,1,1,0,1,1 520
conv,0,0,1,16,80,80,16,16,3,1,1,1 114
conv,0,0,1,16,80,80,64,1,1,0,1,1 416
conv,0,0,1,64,80,80,20,1,1,0,1,1 675
conv,0,0,1,20,80,80,20,20,3,1,1,1 132
conv,0,0,1,20,80,80,64,1,1,0,1,1 496
conv,0,0,1,64,80,80,24,1,1,0,1,1 673
conv,0,0,1,24,80,80,24,24,3,1,1,1 151
conv,0,0,1,24,80,80,64,1,1,0,1,1 578
conv,0,0,1,64,80,80,32,1,1,0,1,1 831
conv,0,0,1,32,80,80,32,32,3,1,1,1 193
conv,0,0,1,32,80,80,64,1,1,0,1,1 750
conv,0,0,1,3,640,640,4,1,3,1,2,1 1630
conv,0,0,1,4,320,320,4,4,3,1,1,1 369
conv,0,0,1,4,320,320,4,1,1,0,1,1 362
conv,0,0,1,4,320,320,4,4,3,1,2,1 216
conv,0,0,1,4,160,160,16,1,1,0,1,1 250
conv,0,0,1,16,160,160,16,16,3,1,1,1 379
conv,0,0,1,16,160,160,16,1,1,0,1,1 550
conv,0,0,1,16,160,160,16,16,3,1,2,1 218
conv,0,0,1,16,80,80,4,1,1,0,1,1 93
conv,0,0,1,4,80,80,88,1,1,0,1,1 279
conv,0,0,1,16,80,80,88,1,1,0,1,1 556
conv,0,0,1,88,80,80,88,88,3,1,1,1 906
conv,0,0,1,88,80,80,4,1,1,0,1,1 488
conv,0,0,1,88,80,80,88,88,3,1,2,1 392
conv,0,0,1,88,40,40,40,1,1,0,1,1 402
conv,0,0,1,88,40,40,48,1,1,0,1,1 465
conv,0,0,1,88,40,40,64,1,1,0,1,1 588
conv,0,0,1,88,40,40,72,1,1,0,1,1 651
conv,0,0,1,88,40,40,80,1,1,0,1,1 708
conv,0,0,1,88,40,40,88,1,1,0,1,1 776
conv,0,0,1,88,40,40,96,1,1,0,1,1 832
conv,0,0,1,88,80,80,8,1,1,0,1,1 549
conv,0,0,1,8,80,80,88,1,1,0,1,1 361
conv,0,0,1,88,80,80,12,1,1,0,1,1 811
conv,0,0,1,12,80,80,88,1,1,0,1,1 451
conv,0,0,1,88,80,80,16,1,1,0,1,1 823
conv,0,0,1,88,80,80,20,1,1,0,1,1 1129
conv,0,0,1,20,80,80,88,1,1,0,1,1 669
conv,0,0,1,88,80,80,24,1,1,0,1,1 1048
conv,0,0,1,24,80,80,88,1,1,0,1,1 777
conv,0,0,1,88,80,80,32,1,1,0,1,1 1396
conv,0,0,1,32,80,80,88,1,1,0,1,1 981
conv,0,0,1,3,640,640,6,1,3,1,2,1 2345
conv,0,0,1,6,320,320,6,6,3,1,1,1 641
conv,0,0,1,6,320,320,6,1,1,0,1,1 1420
conv,0,0,1,6,320,320,6,6,3,1,2,1 350
conv,0,0,1,6,160,160,64,1,1,0,1,1 2723
conv,0,0,1,64,160,160,64,64,3,1,1,1 2451
conv,0,0,1,64,160,160,64,1,1,0,1,1 5851
conv,0,0,1,64,160,160,64,64,3,1,2,1 1141
conv,0,0,1,8,80,80,80,1,1,0,1,1 329
conv,0,0,1,64,80,80,80,1,1,0,1,1 1776
conv,0,0,1,80,80,80,80,80,3,1,1,1 759
conv,0,0,1,80,80,80,4,1,1,0,1,1 437
conv,0,0,1,4,80,80,80,1,1,0,1,1 255
conv,0,0,1,80,80,80,80,80,3,1,2,1 349
conv,0,0,1,80,40,40,40,1,1,0,1,1 385
conv,0,0,1,80,40,40,48,1,1,0,1,1 428
conv,0,0,1,80,40,40,64,1,1,0,1,1 538
conv,0,0,1,80,40,40,72,1,1,0,1,1 592
conv,0,0,1,80,40,40,80,1,1,0,1,1 657
conv,0,0,1,80,40,40,88,1,1,0,1,1 705
conv,0,0,1,80,40,40,96,1,1,0,1,1 771
conv,0,0,1,80,80,80,8,1,1,0,1,1 496
conv,0,0,1,80,80,80,12,1,1,0,1,1 719
conv,0,0,1,12,80,80,80,1,1,0,1,1 414
conv,0,0,1,80,80,80,16,1,1,0,1,1 724
conv,0,0,1,16,80,80,80,1,1,0,1,1 514
conv,0,0,1,80,80,80,20,1,1,0,1,1 946
conv,0,0,1,20,80,80,80,1,1,0,1,1 603
conv,0,0,1,80,80,80,24,1,1,0,1,1 949
conv,0,0,1,24,80,80,80,1,1,0,1,1 741
conv,0,0,1,80,80,80,32,1,1,0,1,1 1214
conv,0,0,1,32,80,80,80,1,1,0,1,1 904
conv,0,0,1,3,640,640,3,1,3,1,2,1 1875
conv,0,0,1,3,320,320,3,3,3,1,1,1 272
conv,0,0,1,3,320,320,3,1,1,0,1,1 425
conv,0,0,1,3,320,320,3,3,3,1,2,1 161
conv,0,0,1,3,160,160,16,1,1,0,1,1 255
conv,0,0,1,16,80,80,16,1,1,0,1,1 151
conv,0,0,1,16,80,80,40,1,1,0,1,1 282
conv,0,0,1,40,80,80,40,40,3,1,1,1 244
conv,0,0,1,40,80,80,4,1,1,0,1,1 184
conv,0,0,1,4,80,80,40,1,1,0,1,1 130
conv,0,0,1,40,80,80,40,40,3,1,2,1 141
conv,0,0,1,40,40,40,40,1,1,0,1,1 180
conv,0,0,1,40,40,40,48,1,1,0,1,1 203
conv,0,0,1,40,40,40,64,1,1,0,1,1 257
conv,0,0,1,40,40,40,72,1,1,0,1,1 278
conv,0,0,1,40,40,40,80,1,1,0,1,1 309
conv,0,0,1,40,40,40,88,1,1,0,1,1 341
conv,0,0,1,40,40,40,96,1,1,0,1,1 360
conv,0,0,1,40,80,80,8,1,1,0,1,1 209
conv,0,0,1,8,80,80,40,1,1,0,1,1 183
conv,0,0,1,40,80,80,12,1,1,0,1,1 314
conv,0,0,1,12,80,80,40,1,1,0,1,1 229
conv,0,0,1,40,80,80,16,1,1,0,1,1 307
conv,0,0,1,40,80,80,20,1,1,0,1,1 408
conv,0,0,1,20,80,80,40,1,1,0,1,1 340
conv,0,0,1,40,80,80,24,1,1,0,1,1 408
conv,0,0,1,24,80,80,40,1,1,0,1,1 390
conv,0,0,1,40,80,80,32,1,1,0,1,1 554
conv,0,0,1,32,80,80,40,1,1,0,1,1 505
conv,0,0,1,3,640,640,32,1,3,1,2,1 7225
conv,0,0,1,32,320,320,32,32,3,1,1,1 5662
conv,0,0,1,32,320,320,32,1,1,0,1,1 9173
conv,0,0,1,32,320,320,32,32,3,1,2,1 4315
conv,0,0,1,32,160,160,48,1,1,0,1,1 2721
conv,0,0,1,48,80,80,24,1,1,0,1,1 479
conv,0,0,1,24,80,80,12,1,1,0,1,1 205
conv,0,0,1,12,80,80,4,1,1,0,1,1 81
conv,0,0,1,4,80,80,12,1,1,0,1,1 76
conv,0,0,1,12,80,80,12,12,3,1,2,1 66
conv,0,0,1,12,80,80,8,1,1,0,1,1 92
conv,0,0,1,8,80,80,12,1,1,0,1,1 102
conv,0,0,1,12,80,80,12,1,1,0,1,1 123
conv,0,0,1,12,80,80,16,1,1,0,1,1 123
conv,0,0,1,16,80,80,12,1,1,0,1,1 157
conv,0,0,1,12,80,80,20,1,1,0,1,1 169
conv,0,0,1,20,80,80,12,1,1,0,1,1 175
conv,0,0,1,12,80,80,24,1,1,0,1,1 163
conv,0,0,1,12,80,80,32,1,1,0,1,1 194
conv,0,0,1,32,80,80,12,1,1,0,1,1 268
conv,0,0,1,32,160,160,8,1,1,0,1,1 734
conv,0,0,1,8,160,160,8,8,3,1,1,1 232
conv,0,0,1,8,160,160,8,1,1,0,1,1 205
conv,0,0,1,8,160,160,8,8,3,1,2,1 121
conv,0,0,1,8,80,80,20,1,1,0,1,1 129
conv,0,0,1,20,80,80,96,1,1,0,1,1 721
conv,0,0,1,8,80,80,96,1,1,0,1,1 413
conv,0,0,1,96,80,80,96,96,3,1,1,1 954
conv,0,0,1,96,80,80,4,1,1,0,1,1 602
conv,0,0,1,4,80,80,96,1,1,0,1,1 311
conv,0,0,1,96,80,80,96,96,3,1,2,1 399
conv,0,0,1,96,40,40,40,1,1,0,1,1 450
conv,0,0,1,96,40,40,48,1,1,0,1,1 509
conv,0,0,1,96,40,40,64,1,1,0,1,1 647
conv,0,0,1,96,40,40,72,1,1,0,1,1 708
conv,0,0,1,96,40,40,80,1,1,0,1,1 777
conv,0,0,1,96,40,40,88,1,1,0,1,1 846
conv,0,0,1,96,40,40,96,1,1,0,1,1 966
conv,0,0,1,96,80,80,8,1,1,0,1,1 613
conv,0,0,1,96,80,80,12,1,1,0,1,1 870
conv,0,0,1,12,80,80,96,1,1,0,1,1 491
conv,0,0,1,96,80,80,16,1,1,0,1,1 829
conv,0,0,1,16,80,80,96,1,1,0,1,1 630
conv,0,0,1,96,80,80,20,1,1,0,1,1 1123
conv,0,0,1,96,80,80,24,1,1,0,1,1 1129
conv,0,0,1,24,80,80,96,1,1,0,1,1 840
conv,0,0,1,96,80,80,32,1,1,0,1,1 1410
conv,0,0,1,32,80,80,96,1,1,0,1,1 1091
conv,0,0,1,3,640,640,16,1,3,1,2,1 4039
conv,0,0,1,16,320,320,16,16,3,1,1,1 2139
conv,0,0,1,16,320,320,16,1,1,0,1,1 3055
conv,0,0,1,16,320,320,16,16,3,1,2,1 1046
conv,0,0,1,16,160,160,80,1,1,0,1,1 3444
conv,0,0,1,80,160,160,80,80,3,1,1,1 3179
conv,0,0,1,80,160,160,80,1,1,0,1,1 9469
conv,0,0,1,80,160,160,80,80,3,1,2,1 1563
conv,0,0,1,20,80,80,8,1,1,0,1,1 120
conv,0,0,1,8,80,80,4,1,1,0,1,1 69
conv,0,0,1,4,80,80,8,1,1,0,1,1 60
conv,0,0,1,8,80,80,8,8,3,1,2,1 56
conv,0,0,1,8,80,80,8,1,1,0,1,1 75
conv,0,0,1,8,80,80,16,1,1,0,1,1 102
conv,0,0,1,16,80,80,8,1,1,0,1,1 105
conv,0,0,1,8,80,80,24,1,1,0,1,1 135
conv,0,0,1,24,80,80,8,1,1,0,1,1 139
conv,0,0,1,8,80,80,32,1,1,0,1,1 153
conv,0,0,1,32,80,80,8,1,1,0,1,1 173
conv,0,0,1,6,160,160,16,1,1,0,1,1 343
conv,0,0,1,16,80,80,20,1,1,0,1,1 198
conv,0,0,1,4,160,160,48,1,1,0,1,1 1814
conv,0,0,1,48,80,80,4,1,1,0,1,1 232
conv,0,0,1,32,160,160,72,1,1,0,1,1 3909
conv,0,0,1,72,160,160,72,72,3,1,1,1 2822
conv,0,0,1,72,160,160,72,1,1,0,1,1 13548
conv,0,0,1,72,160,160,72,72,3,1,2,1 1410
conv,0,0,1,72,80,80,16,1,1,0,1,1 696
conv,0,0,1,72,80,80,88,1,1,0,1,1 2605
conv,0,0,1,8,160,160,24,1,1,0,1,1 577
conv,0,0,1,24,160,160,24,24,3,1,1,1 712
conv,0,0,1,24,160,160,24,1,1,0,1,1 1186
conv,0,0,1,24,160,160,24,24,3,1,2,1 349
conv,0,0,1,12,80,80,48,1,1,0,1,1 267
conv,0,0,1,24,80,80,48,1,1,0,1,1 452
conv,0,0,1,48,80,80,48,48,3,1,1,1 287
conv,0,0,1,4,80,80,48,1,1,0,1,1 151
conv,0,0,1,48,80,80,48,48,3,1,2,1 169
conv,0,0,1,48,40,40,40,1,1,0,1,1 210
conv,0,0,1,48,40,40,48,1,1,0,1,1 235
conv,0,0,1,48,40,40,64,1,1,0,1,1 353
conv,0,0,1,48,40,40,72,1,1,0,1,1 323
conv,0,0,1,48,40,40,80,1,1,0,1,1 356
conv,0,0,1,48,40,40,88,1,1,0,1,1 386
conv,0,0,1,48,40,40,96,1,1,0,1,1 412
conv,0,0,1,48,80,80,8,1,1,0,1,1 240
conv,0,0,1,8,80,80,48,1,1,0,1,1 208
conv,0,0,1,48,80,80,16,1,1,0,1,1 362
conv,0,0,1,16,80,80,48,1,1,0,1,1 329
conv,0,0,1,48,80,80,20,1,1,0,1,1 481
conv,0,0,1,20,80,80,48,1,1,0,1,1 389
conv,0,0,1,48,80,80,32,1,1,0,1,1 597
conv,0,0,1,32,80,80,48,1,1,0,1,1 582
conv,0,0,1,3,160,160,72,1,1,0,1,1 2907
conv,0,0,1,72,80,80,8,1,1,0,1,1 478
conv,0,0,1,8,80,80,72,1,1,0,1,1 309
conv,0,0,1,72,80,80,72,1,1,0,1,1 2160
conv,0,0,1,72,80,80,72,72,3,1,1,1 634
conv,0,0,1,72,80,80,4,1,1,0,1,1 567
conv,0,0,1,4,80,80,72,1,1,0,1,1 228
conv,0,0,1,72,80,80,72,72,3,1,2,1 331
conv,0,0,1,72,40,40,40,1,1,0,1,1 340
conv,0,0,1,72,40,40,48,1,1,0,1,1 390
conv,0,0,1,72,40,40,64,1,1,0,1,1 493
conv,0,0,1,72,40,40,72,1,1,0,1,1 542
conv,0,0,1,72,40,40,80,1,1,0,1,1 589
conv,0,0,1,72,40,40,88,1,1,0,1,1 695
conv,0,0,1,72,40,40,96,1,1,0,1,1 690
conv,0,0,1,72,80,80,12,1,1,0,1,1 696
conv,0,0,1,12,80,80,72,1,1,0,1,1 373
conv,0,0,1,16,80,80,72,1,1,0,1,1 459
conv,0,0,1,72,80,80,20,1,1,0,1,1 904
conv,0,0,1,20,80,80,72,1,1,0,1,1 549
conv,0,0,1,72,80,80,24,1,1,0,1,1 882
conv,0,0,1,24,80,80,72,1,1,0,1,1 663
conv,0,0,1,72,80,80,32,1,1,0,1,1 1116
conv,0,0,1,32,80,80,72,1,1,0,1,1 824
conv,0,0,1,4,160,160,64,1,1,0,1,1 2675
conv,0,0,1,64,80,80,48,1,1,0,1,1 1133
conv,0,0,1,6,160,160,12,1,1,0,1,1 295
conv,0,0,1,12,160,160,12,12,3,1,1,1 274
conv,0,0,1,12,160,160,12,1,1,0,1,1 425
conv,0,0,1,12,160,160,12,12,3,1,2,1 161
conv,0,0,1,3,640,640,24,1,3,1,2,1 5714
conv,0,0,1,24,320,320,24,24,3,1,1,1 3212
conv,0,0,1,24,320,320,24,1,1,0,1,1 5062
conv,0,0,1,24,320,320,24,24,3,1,2,1 1660
conv,0,0,1,24,160,160,80,1,1,0,1,1 3769
conv,0,0,1,24,160,160,72,1,1,0,1,1 3184
conv,0,0,1,72,80,80,96,1,1,0,1,1 2801
conv,0,0,1,3,160,160,12,1,1,0,1,1 198
conv,0,0,1,24,80,80,4,1,1,0,1,1 119
conv,0,0,1,4,80,80,32,1,1,0,1,1 111
conv,0,0,1,24,80,80,32,1,1,0,1,1 330
conv,0,0,1,32,80,80,4,1,1,0,1,1 159
conv,0,0,1,32,80,80,32,32,3,1,2,1 118
conv,0,0,1,32,80,80,16,1,1,0,1,1 253
conv,0,0,1,16,80,80,32,1,1,0,1,1 239
conv,0,0,1,32,80,80,20,1,1,0,1,1 336
conv,0,0,1,20,80,80,32,1,1,0,1,1 281
conv,0,0,1,32,80,80,24,1,1,0,1,1 335
conv,0,0,1,32,80,80,32,1,1,0,1,1 417
conv,0,0,1,8,160,160,32,1,1,0,1,1 958
conv,0,0,1,32,160,160,32,32,3,1,1,1 1158
conv,0,0,1,32,160,160,32,1,1,0,1,1 1916
conv,0,0,1,32,160,160,32,32,3,1,2,1 512
conv,0,0,1,8,160,160,72,1,1,0,1,1 3060
conv,0,0,1,72,80,80,40,1,1,0,1,1 1303
conv,0,0,1,24,160,160,48,1,1,0,1,1 2195
conv,0,0,1,48,80,80,48,1,1,0,1,1 832
conv,0,0,1,24,160,160,16,1,1,0,1,1 821
conv,0,0,1,16,80,80,24,1,1,0,1,1 192
conv,0,0,1,8,160,160,80,1,1,0,1,1 3336
conv,0,0,1,80,80,80,96,1,1,0,1,1 3159
conv,0,0,1,16,160,160,12,1,1,0,1,1 530
conv,0,0,1,24,160,160,40,1,1,0,1,1 1883
conv,0,0,1,40,160,160,40,40,3,1,1,1 1463
conv,0,0,1,40,160,160,40,1,1,0,1,1 2646
conv,0,0,1,40,160,160,40,40,3,1,2,1 683
conv,0,0,1,4,80,80,16,1,1,0,1,1 77
conv,0,0,1,16,80,80,16,16,3,1,2,1 77
conv,0,0,1,20,80,80,16,1,1,0,1,1 176
conv,0,0,1,24,80,80,16,1,1,0,1,1 205
conv,0,0,1,4,160,160,40,1,1,0,1,1 1272
conv,0,0,1,4,160,160,24,1,1,0,1,1 454
conv,0,0,1,72,80,80,64,1,1,0,1,1 1964
conv,0,0,1,4,160,160,72,1,1,0,1,1 3063
conv,0,0,1,3,160,160,64,1,1,0,1,1 2558
conv,0,0,1,48,80,80,80,1,1,0,1,1 1323
conv,0,0,1,32,160,160,16,1,1,0,1,1 1144
conv,0,0,1,24,80,80,24,1,1,0,1,1 270
conv,0,0,1,4,80,80,24,1,1,0,1,1 99
conv,0,0,1,24,80,80,24,24,3,1,2,1 97
conv,0,0,1,24,80,80,20,1,1,0,1,1 265
conv,0,0,1,20,80,80,24,1,1,0,1,1 226
conv,0,0,1,3,160,160,80,1,1,0,1,1 3405
conv,0,0,1,80,80,80,80,1,1,0,1,1 2561
conv,0,0,1,48,80,80,96,1,1,0,1,1 1564
conv,0,0,1,3,640,640,12,1,3,1,2,1 3237
conv,0,0,1,12,320,320,12,12,3,1,1,1 1566
conv,0,0,1,12,320,320,12,1,1,0,1,1 2254
conv,0,0,1,12,320,320,12,12,3,1,2,1 820
conv,0,0,1,12,160,160,64,1,1,0,1,1 2813
conv,0,0,1,32,160,160,40,1,1,0,1,1 2293
conv,0,0,1,40,80,80,96,1,1,0,1,1 1401
conv,0,0,1,8,160,160,64,1,1,0,1,1 2732
conv,0,0,1,6,160,160,8,1,1,0,1,1 207
conv,0,0,1,16,160,160,48,1,1,0,1,1 2040
conv,0,0,1,12,160,160,32,1,1,0,1,1 1326
conv,0,0,1,12,160,160,72,1,1,0,1,1 3181
conv,0,0,1,16,160,160,40,1,1,0,1,1 1673
conv,0,0,1,40,80,80,64,1,1,0,1,1 941
conv,0,0,1,24,160,160,32,1,1,0,1,1 1537
conv,0,0,1,8,160,160,12,1,1,0,1,1 311
conv,0,0,1,24,160,160,64,1,1,0,1,1 2861
conv,0,0,1,32,160,160,12,1,1,0,1,1 1065
conv,0,0,1,4,160,160,8,1,1,0,1,1 131
conv,0,0,1,80,80,80,64,1,1,0,1,1 2138
conv,0,0,1,12,160,160,8,1,1,0,1,1 278
conv,0,0,1,40,80,80,80,1,1,0,1,1 1112
conv,0,0,1,8,160,160,16,1,1,0,1,1 349
conv,0,0,1,3,160,160,32,1,1,0,1,1 795
conv,0,0,1,48,80,80,40,1,1,0,1,1 713
conv,0,0,1,4,160,160,80,1,1,0,1,1 3412
conv,0,0,1,3,160,160,8,1,1,0,1,1 145
conv,0,0,1,6,160,160,32,1,1,0,1,1 1065
conv,0,0,1,3,160,160,48,1,1,0,1,1 1738
conv,0,0,1,72,80,80,80,1,1,0,1,1 2428
conv,0,0,1,64,80,80,64,1,1,0,1,1 1459
conv,0,0,1,80,80,80,72,1,1,0,1,1 2322
conv,0,0,1,24,160,160,8,1,1,0,1,1 495
conv,0,0,1,3,160,160,40,1,1,0,1,1 1308
conv,0,0,1,6,160,160,72,1,1,0,1,1 3064
conv,0,0,1,12,160,160,48,1,1,0,1,1 2141
conv,0,0,1,48,80,80,72,1,1,0,1,1 1213
conv,0,0,1,16,160,160,8,1,1,0,1,1 338
conv,0,0,1,80,80,80,40,1,1,0,1,1 1485
conv,0,0,1,40,80,80,48,1,1,0,1,1 699
conv,0,0,1,48,80,80,88,1,1,0,1,1 1449
conv,0,0,1,32,160,160,80,1,1,0,1,1 4329
conv,0,0,1,72,80,80,48,1,1,0,1,1 1511
conv,0,0,1,6,160,160,48,1,1,0,1,1 2062
conv,0,0,1,12,160,160,16,1,1,0,1,1 465
conv,0,0,1,12,160,160,40,1,1,0,1,1 1716
conv,0,0,1,3,160,160,24,1,1,0,1,1 418
conv,0,0,1,40,80,80,40,1,1,0,1,1 603
conv,0,0,1,16,160,160,24,1,1,0,1,1 922
conv,0,0,1,6,160,160,40,1,1,0,1,1 1637
conv,0,0,1,16,160,160,32,1,1,0,1,1 1382
conv,0,0,1,16,160,160,64,1,1,0,1,1 2676
conv,0,0,1,64,80,80,72,1,1,0,1,1 1615
conv,0,0,1,6,160,160,80,1,1,0,1,1 3375
conv,0,0,1,32,160,160,64,1,1,0,1,1 3540
conv,0,0,1,64,80,80,40,1,1,0,1,1 1017
conv,0,0,1,12,160,160,24,1,1,0,1,1 859
conv,0,0,1,24,160,160,12,1,1,0,1,1 792
conv,0,0,1,16,160,160,72,1,1,0,1,1 3029
conv,0,0,1,4,160,160,12,1,1,0,1,1 202
conv,0,0,1,4,160,160,32,1,1,0,1,1 715
conv,0,0,1,64,80,80,96,1,1,0,1,1 2130
conv,0,0,1,12,160,160,80,1,1,0,1,1 3446
conv,0,0,1,80,80,80,48,1,1,0,1,1 1679
conv,0,0,1,6,160,160,24,1,1,0,1,1 695
conv,0,0,1,40,80,80,88,1,1,0,1,1 1207
conv,0,0,1,80,80,80,88,1,1,0,1,1 2847
conv,0,0,1,32,160,160,24,1,1,0,1,1 1539
conv,0,0,1,64,80,80,88,1,1,0,1,1 1932
conv,0,0,1,40,80,80,72,1,1,0,1,1 1000
conv,0,0,1,8,160,160,40,1,1,0,1,1 1468
conv,0,0,1,8,80,80,8,1,3,1,1,1 318
conv,0,0,1,8,80,80,4,1,3,1,1,1 230
conv,0,0,1,8,40,40,24,1,3,1,1,1 269
conv,0,0,1,8,40,40,12,1,3,1,1,1 167
conv,0,0,1,12,40,40,24,1,3,1,1,1 402
conv,0,0,1,12,40,40,12,1,3,1,1,1 221
conv,0,0,1,16,40,40,24,1,3,1,1,1 522
conv,0,0,1,16,40,40,12,1,3,1,1,1 267
conv,0,0,1,24,40,40,24,1,3,1,1,1 668
conv,0,0,1,24,40,40,12,1,3,1,1,1 407
conv,0,0,1,32,40,40,24,1,3,1,1,1 841
conv,0,0,1,32,40,40,12,1,3,1,1,1 488
conv,0,0,1,40,40,40,24,1,3,1,1,1 1083
conv,0,0,1,40,40,40,12,1,3,1,1,1 635
conv,0,0,1,48,40,40,24,1,3,1,1,1 1388
conv,0,0,1,48,40,40,12,1,3,1,1,1 743
conv,0,0,1,64,40,40,24,1,3,1,1,1 1658
conv,0,0,1,64,40,40,12,1,3,1,1,1 913
conv,0,0,1,72,40,40,24,1,3,1,1,1 2248
conv,0,0,1,72,40,40,12,1,3,1,1,1 1255
conv,0,0,1,80,40,40,24,1,3,1,1,1 2433
conv,0,0,1,80,40,40,12,1,3,1,1,1 1411
conv,0,0,1,88,40,40,24,1,3,1,1,1 2779
conv,0,0,1,88,40,40,12,1,3,1,1,1 1654
conv,0,0,1,96,40,40,24,1,3,1,1,1 3261
conv,0,0,1,96,40,40,12,1,3,1,1,1 1826
conv,0,0,1,12,80,80,8,1,3,1,1,1 412
conv,0,0,1,12,80,80,4,1,3,1,1,1 302
conv,0,0,1,16,80,80,8,1,3,1,1,1 501
conv,0,0,1,16,80,80,4,1,3,1,1,1 376
conv,0,0,1,24,80,80,8,1,3,1,1,1 714
conv,0,0,1,24,80,80,4,1,3,1,1,1 548
conv,0,0,1,32,80,80,8,1,3,1,1,1 905
conv,0,0,1,32,80,80,4,1,3,1,1,1 696
conv,0,0,1,40,80,80,8,1,3,1,1,1 1209
conv,0,0,1,40,80,80,4,1,3,1,1,1 965
conv,0,0,1,48,80,80,8,1,3,1,1,1 1446
conv,0,0,1,48,80,80,4,1,3,1,1,1 1089
conv,0,0,1,64,80,80,8,1,3,1,1,1 2003
conv,0,0,1,64,80,80,4,1,3,1,1,1 1535
conv,0,0,1,72,80,80,8,1,3,1,1,1 2937
conv,0,0,1,72,80,80,4,1,3,1,1,1 2232
conv,0,0,1,80,80,80,8,1,3,1,1,1 3116
conv,0,0,1,80,80,80,4,1,3,1,1,1 2484
conv,0,0,1,88,80,80,8,1,3,1,1,1 3616
conv,0,0,1,88,80,80,4,1,3,1,1,1 2975
conv,0,0,1,96,80,80,8,1,3,1,1,1 4083
conv,0,0,1,96,80,80,4,1,3,1,1,1 3568
slim/nas/train_nas.py
浏览文件 @
9e306e6e
...
...
@@ -40,7 +40,7 @@ import sys
sys
.
path
.
append
(
"../../"
)
from
ppdet.experimental
import
mixed_precision_context
from
ppdet.core.workspace
import
load_config
,
merge_config
,
create
from
ppdet.core.workspace
import
load_config
,
merge_config
,
create
,
register
from
ppdet.data.reader
import
create_reader
from
ppdet.utils
import
dist_utils
...
...
@@ -49,7 +49,7 @@ from ppdet.utils.stats import TrainingStats
from
ppdet.utils.cli
import
ArgsParser
from
ppdet.utils.check
import
check_gpu
,
check_version
import
ppdet.utils.checkpoint
as
checkpoint
from
paddleslim.analysis
import
flops
from
paddleslim.analysis
import
flops
,
TableLatencyEvaluator
from
paddleslim.nas
import
SANAS
import
search_space
...
...
@@ -59,6 +59,40 @@ logging.basicConfig(level=logging.INFO, format=FORMAT)
logger
=
logging
.
getLogger
(
__name__
)
@
register
class
Constraint
(
object
):
"""
Constraint for nas
"""
def
__init__
(
self
,
ctype
,
max_constraint
=
None
,
min_constraint
=
None
,
table_file
=
None
):
super
(
Constraint
,
self
).
__init__
()
self
.
ctype
=
ctype
self
.
max_constraint
=
max_constraint
self
.
min_constraint
=
min_constraint
self
.
table_file
=
table_file
def
compute_constraint
(
self
,
program
):
if
self
.
ctype
==
'flops'
:
model_status
=
flops
(
program
)
elif
self
.
ctype
==
'latency'
:
assert
os
.
path
.
exists
(
self
.
table_file
),
"latency constraint must have latency table, please check whether table file exist!"
model_latency
=
TableLatencyEvaluator
(
self
.
table_file
)
model_status
=
model_latency
.
latency
(
program
,
only_conv
=
True
)
else
:
raise
NotImplementedError
(
"{} constraint is NOT support!!! Now PaddleSlim support flops constraint and latency constraint"
.
format
(
self
.
ctype
))
return
model_status
def
get_bboxes_scores
(
result
):
bboxes
=
result
[
'bbox'
][
0
]
gt_bbox
=
result
[
'gt_bbox'
][
0
]
...
...
@@ -223,6 +257,7 @@ def main():
devices_num
,
cfg
)
eval_reader
=
create_reader
(
cfg
.
EvalReader
)
constraint
=
create
(
'Constraint'
)
for
step
in
range
(
cfg
.
search_steps
):
logger
.
info
(
'----->>> search step: {} <<<------'
.
format
(
step
))
archs
=
sa_nas
.
next_archs
()[
0
]
...
...
@@ -252,9 +287,15 @@ def main():
optimizer
.
minimize
(
loss
)
if
FLAGS
.
fp16
:
loss
/=
ctx
.
get_loss_scale_var
()
current_flops
=
flops
(
train_prog
)
logger
.
info
(
'current steps: {}, flops {}'
.
format
(
step
,
current_flops
))
if
current_flops
>
cfg
.
max_flops
:
current_constraint
=
constraint
.
compute_constraint
(
train_prog
)
logger
.
info
(
'current steps: {}, constraint {}'
.
format
(
step
,
current_constraint
))
if
(
constraint
.
max_constraint
!=
None
and
current_constraint
>
constraint
.
max_constraint
)
or
(
constraint
.
min_constraint
!=
None
and
current_constraint
<
constraint
.
min_constraint
):
continue
# parse train fetches
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录