Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
0d1721e6
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看板
提交
0d1721e6
编写于
9月 24, 2020
作者:
S
still-wait
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clean useless log in DataLoader
上级
5549e083
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
44 addition
and
22 deletion
+44
-22
.gitignore
.gitignore
+3
-0
docs/advanced_tutorials/READER.md
docs/advanced_tutorials/READER.md
+1
-1
slim/distillation/distill.py
slim/distillation/distill.py
+4
-2
slim/extensions/distill_pruned_model/distill_pruned_model.py
slim/extensions/distill_pruned_model/distill_pruned_model.py
+4
-2
slim/nas/train_nas.py
slim/nas/train_nas.py
+4
-3
slim/prune/eval.py
slim/prune/eval.py
+2
-1
slim/prune/infer.py
slim/prune/infer.py
+2
-1
slim/prune/prune.py
slim/prune/prune.py
+2
-1
slim/quantization/eval.py
slim/quantization/eval.py
+2
-1
slim/quantization/infer.py
slim/quantization/infer.py
+2
-1
slim/quantization/train.py
slim/quantization/train.py
+4
-2
slim/sensitive/sensitive.py
slim/sensitive/sensitive.py
+2
-1
tools/eval.py
tools/eval.py
+2
-1
tools/infer.py
tools/infer.py
+2
-1
tools/train.py
tools/train.py
+4
-2
tools/train_multi_machine.py
tools/train_multi_machine.py
+4
-2
未找到文件。
.gitignore
浏览文件 @
0d1721e6
...
@@ -13,6 +13,9 @@ __pycache__/
...
@@ -13,6 +13,9 @@ __pycache__/
# json file
# json file
*.json
*.json
# log file
*.log
# Distribution / packaging
# Distribution / packaging
/bin/
/bin/
/build/
/build/
...
...
docs/advanced_tutorials/READER.md
浏览文件 @
0d1721e6
...
@@ -406,7 +406,7 @@ reader = create_reader(cfg.EvalReader)
...
@@ -406,7 +406,7 @@ reader = create_reader(cfg.EvalReader)
# infer
# infer
reader = create_reader(cfg.TestReader)
reader = create_reader(cfg.TestReader)
# 将reader设置为DataLoader数据源
# 将reader设置为DataLoader数据源
loader.set_sample_list_generator(reader
, place
)
loader.set_sample_list_generator(reader)
```
```
在运行程序中设置完数据处理模块后,就可以开始训练、评估与测试了,具体请参考相应运行程序python源码。
在运行程序中设置完数据处理模块后,就可以开始训练、评估与测试了,具体请参考相应运行程序python源码。
...
...
slim/distillation/distill.py
浏览文件 @
0d1721e6
...
@@ -160,7 +160,8 @@ def main():
...
@@ -160,7 +160,8 @@ def main():
start_iter
=
0
start_iter
=
0
train_reader
=
create_reader
(
cfg
.
TrainReader
,
(
cfg
.
max_iters
-
start_iter
)
*
train_reader
=
create_reader
(
cfg
.
TrainReader
,
(
cfg
.
max_iters
-
start_iter
)
*
devices_num
,
cfg
)
devices_num
,
cfg
)
train_loader
.
set_sample_list_generator
(
train_reader
,
place
)
# When iterable mode, set set_sample_list_generator(train_reader, place)
train_loader
.
set_sample_list_generator
(
train_reader
)
# get all student variables
# get all student variables
student_vars
=
[]
student_vars
=
[]
...
@@ -183,7 +184,8 @@ def main():
...
@@ -183,7 +184,8 @@ def main():
eval_prog
=
eval_prog
.
clone
(
True
)
eval_prog
=
eval_prog
.
clone
(
True
)
eval_reader
=
create_reader
(
cfg
.
EvalReader
)
eval_reader
=
create_reader
(
cfg
.
EvalReader
)
eval_loader
.
set_sample_list_generator
(
eval_reader
,
place
)
# When iterable mode, set set_sample_list_generator(eval_reader, place)
eval_loader
.
set_sample_list_generator
(
eval_reader
)
# parse eval fetches
# parse eval fetches
extra_keys
=
[]
extra_keys
=
[]
...
...
slim/extensions/distill_pruned_model/distill_pruned_model.py
浏览文件 @
0d1721e6
...
@@ -149,7 +149,8 @@ def main():
...
@@ -149,7 +149,8 @@ def main():
start_iter
=
0
start_iter
=
0
train_reader
=
create_reader
(
cfg
.
TrainReader
,
(
cfg
.
max_iters
-
start_iter
)
*
train_reader
=
create_reader
(
cfg
.
TrainReader
,
(
cfg
.
max_iters
-
start_iter
)
*
devices_num
,
cfg
)
devices_num
,
cfg
)
train_loader
.
set_sample_list_generator
(
train_reader
,
place
)
# When iterable mode, set set_sample_list_generator(train_reader, place)
train_loader
.
set_sample_list_generator
(
train_reader
)
eval_prog
=
fluid
.
Program
()
eval_prog
=
fluid
.
Program
()
with
fluid
.
program_guard
(
eval_prog
,
fluid
.
default_startup_program
()):
with
fluid
.
program_guard
(
eval_prog
,
fluid
.
default_startup_program
()):
...
@@ -161,7 +162,8 @@ def main():
...
@@ -161,7 +162,8 @@ def main():
eval_prog
=
eval_prog
.
clone
(
True
)
eval_prog
=
eval_prog
.
clone
(
True
)
eval_reader
=
create_reader
(
cfg
.
EvalReader
)
eval_reader
=
create_reader
(
cfg
.
EvalReader
)
eval_loader
.
set_sample_list_generator
(
eval_reader
,
place
)
# When iterable mode, set set_sample_list_generator(eval_reader, place)
eval_loader
.
set_sample_list_generator
(
eval_reader
)
teacher_cfg
=
load_config
(
FLAGS
.
teacher_config
)
teacher_cfg
=
load_config
(
FLAGS
.
teacher_config
)
merge_config
(
FLAGS
.
opt
)
merge_config
(
FLAGS
.
opt
)
...
...
slim/nas/train_nas.py
浏览文件 @
0d1721e6
...
@@ -296,7 +296,8 @@ def main():
...
@@ -296,7 +296,8 @@ def main():
fetches
=
archs
(
feed_vars
,
'eval'
,
cfg
)
fetches
=
archs
(
feed_vars
,
'eval'
,
cfg
)
eval_prog
=
eval_prog
.
clone
(
True
)
eval_prog
=
eval_prog
.
clone
(
True
)
eval_loader
.
set_sample_list_generator
(
eval_reader
,
place
)
# When iterable mode, set set_sample_list_generator(eval_reader, place)
eval_loader
.
set_sample_list_generator
(
eval_reader
)
extra_keys
=
[
'im_id'
,
'im_shape'
,
'gt_bbox'
]
extra_keys
=
[
'im_id'
,
'im_shape'
,
'gt_bbox'
]
eval_keys
,
eval_values
,
eval_cls
=
parse_fetches
(
fetches
,
eval_prog
,
eval_keys
,
eval_values
,
eval_cls
=
parse_fetches
(
fetches
,
eval_prog
,
extra_keys
)
extra_keys
)
...
@@ -324,8 +325,8 @@ def main():
...
@@ -324,8 +325,8 @@ def main():
exec_strategy
=
exec_strategy
)
exec_strategy
=
exec_strategy
)
if
FLAGS
.
eval
:
if
FLAGS
.
eval
:
compiled_eval_prog
=
fluid
.
CompiledProgram
(
eval_prog
)
compiled_eval_prog
=
fluid
.
CompiledProgram
(
eval_prog
)
# When iterable mode, set set_sample_list_generator(train_reader, place)
train_loader
.
set_sample_list_generator
(
train_reader
,
place
)
train_loader
.
set_sample_list_generator
(
train_reader
)
train_stats
=
TrainingStats
(
cfg
.
log_smooth_window
,
train_keys
)
train_stats
=
TrainingStats
(
cfg
.
log_smooth_window
,
train_keys
)
train_loader
.
start
()
train_loader
.
start
()
...
...
slim/prune/eval.py
浏览文件 @
0d1721e6
...
@@ -78,7 +78,8 @@ def main():
...
@@ -78,7 +78,8 @@ def main():
exe
.
run
(
startup_prog
)
exe
.
run
(
startup_prog
)
reader
=
create_reader
(
cfg
.
EvalReader
)
reader
=
create_reader
(
cfg
.
EvalReader
)
loader
.
set_sample_list_generator
(
reader
,
place
)
# When iterable mode, set set_sample_list_generator(reader, place)
loader
.
set_sample_list_generator
(
reader
)
dataset
=
cfg
[
'EvalReader'
][
'dataset'
]
dataset
=
cfg
[
'EvalReader'
][
'dataset'
]
...
...
slim/prune/infer.py
浏览文件 @
0d1721e6
...
@@ -147,7 +147,8 @@ def main():
...
@@ -147,7 +147,8 @@ def main():
logger
.
info
(
"pruned FLOPS: {}"
.
format
(
logger
.
info
(
"pruned FLOPS: {}"
.
format
(
float
(
base_flops
-
pruned_flops
)
/
base_flops
))
float
(
base_flops
-
pruned_flops
)
/
base_flops
))
reader
=
create_reader
(
cfg
.
TestReader
,
devices_num
=
1
)
reader
=
create_reader
(
cfg
.
TestReader
,
devices_num
=
1
)
loader
.
set_sample_list_generator
(
reader
,
place
)
# When iterable mode, set set_sample_list_generator(reader, place)
loader
.
set_sample_list_generator
(
reader
)
exe
.
run
(
startup_prog
)
exe
.
run
(
startup_prog
)
if
cfg
.
weights
:
if
cfg
.
weights
:
...
...
slim/prune/prune.py
浏览文件 @
0d1721e6
...
@@ -132,7 +132,8 @@ def main():
...
@@ -132,7 +132,8 @@ def main():
eval_prog
=
eval_prog
.
clone
(
True
)
eval_prog
=
eval_prog
.
clone
(
True
)
eval_reader
=
create_reader
(
cfg
.
EvalReader
)
eval_reader
=
create_reader
(
cfg
.
EvalReader
)
eval_loader
.
set_sample_list_generator
(
eval_reader
,
place
)
# When iterable mode, set set_sample_list_generator(eval_reader, place)
eval_loader
.
set_sample_list_generator
(
eval_reader
)
# parse eval fetches
# parse eval fetches
extra_keys
=
[]
extra_keys
=
[]
...
...
slim/quantization/eval.py
浏览文件 @
0d1721e6
...
@@ -73,7 +73,8 @@ def main():
...
@@ -73,7 +73,8 @@ def main():
eval_prog
=
eval_prog
.
clone
(
True
)
eval_prog
=
eval_prog
.
clone
(
True
)
reader
=
create_reader
(
cfg
.
EvalReader
)
reader
=
create_reader
(
cfg
.
EvalReader
)
loader
.
set_sample_list_generator
(
reader
,
place
)
# When iterable mode, set set_sample_list_generator(reader, place)
loader
.
set_sample_list_generator
(
reader
)
# eval already exists json file
# eval already exists json file
if
FLAGS
.
json_eval
:
if
FLAGS
.
json_eval
:
...
...
slim/quantization/infer.py
浏览文件 @
0d1721e6
...
@@ -75,7 +75,8 @@ def main():
...
@@ -75,7 +75,8 @@ def main():
infer_prog
=
infer_prog
.
clone
(
True
)
infer_prog
=
infer_prog
.
clone
(
True
)
reader
=
create_reader
(
cfg
.
TestReader
)
reader
=
create_reader
(
cfg
.
TestReader
)
loader
.
set_sample_list_generator
(
reader
,
place
)
# When iterable mode, set set_sample_list_generator(reader, place)
loader
.
set_sample_list_generator
(
reader
)
not_quant_pattern
=
[]
not_quant_pattern
=
[]
if
FLAGS
.
not_quant_pattern
:
if
FLAGS
.
not_quant_pattern
:
not_quant_pattern
=
FLAGS
.
not_quant_pattern
not_quant_pattern
=
FLAGS
.
not_quant_pattern
...
...
slim/quantization/train.py
浏览文件 @
0d1721e6
...
@@ -129,7 +129,8 @@ def main():
...
@@ -129,7 +129,8 @@ def main():
eval_prog
=
eval_prog
.
clone
(
True
)
eval_prog
=
eval_prog
.
clone
(
True
)
eval_reader
=
create_reader
(
cfg
.
EvalReader
)
eval_reader
=
create_reader
(
cfg
.
EvalReader
)
eval_loader
.
set_sample_list_generator
(
eval_reader
,
place
)
# When iterable mode, set set_sample_list_generator(eval_reader, place)
eval_loader
.
set_sample_list_generator
(
eval_reader
)
# parse eval fetches
# parse eval fetches
extra_keys
=
[]
extra_keys
=
[]
...
@@ -210,7 +211,8 @@ def main():
...
@@ -210,7 +211,8 @@ def main():
train_reader
=
create_reader
(
cfg
.
TrainReader
,
train_reader
=
create_reader
(
cfg
.
TrainReader
,
(
cfg
.
max_iters
-
start_iter
)
*
devices_num
)
(
cfg
.
max_iters
-
start_iter
)
*
devices_num
)
train_loader
.
set_sample_list_generator
(
train_reader
,
place
)
# When iterable mode, set set_sample_list_generator(train_reader, place)
train_loader
.
set_sample_list_generator
(
train_reader
)
# whether output bbox is normalized in model output layer
# whether output bbox is normalized in model output layer
is_bbox_normalized
=
False
is_bbox_normalized
=
False
...
...
slim/sensitive/sensitive.py
浏览文件 @
0d1721e6
...
@@ -84,7 +84,8 @@ def main():
...
@@ -84,7 +84,8 @@ def main():
return
return
eval_reader
=
create_reader
(
cfg
.
EvalReader
)
eval_reader
=
create_reader
(
cfg
.
EvalReader
)
eval_loader
.
set_sample_list_generator
(
eval_reader
,
place
)
# When iterable mode, set set_sample_list_generator(eval_reader, place)
eval_loader
.
set_sample_list_generator
(
eval_reader
)
# parse eval fetches
# parse eval fetches
extra_keys
=
[]
extra_keys
=
[]
...
...
tools/eval.py
浏览文件 @
0d1721e6
...
@@ -74,7 +74,8 @@ def main():
...
@@ -74,7 +74,8 @@ def main():
eval_prog
=
eval_prog
.
clone
(
True
)
eval_prog
=
eval_prog
.
clone
(
True
)
reader
=
create_reader
(
cfg
.
EvalReader
,
devices_num
=
1
)
reader
=
create_reader
(
cfg
.
EvalReader
,
devices_num
=
1
)
loader
.
set_sample_list_generator
(
reader
,
place
)
# When iterable mode, set set_sample_list_generator(reader, place)
loader
.
set_sample_list_generator
(
reader
)
dataset
=
cfg
[
'EvalReader'
][
'dataset'
]
dataset
=
cfg
[
'EvalReader'
][
'dataset'
]
...
...
tools/infer.py
浏览文件 @
0d1721e6
...
@@ -120,7 +120,8 @@ def main():
...
@@ -120,7 +120,8 @@ def main():
infer_prog
=
infer_prog
.
clone
(
True
)
infer_prog
=
infer_prog
.
clone
(
True
)
reader
=
create_reader
(
cfg
.
TestReader
,
devices_num
=
1
)
reader
=
create_reader
(
cfg
.
TestReader
,
devices_num
=
1
)
loader
.
set_sample_list_generator
(
reader
,
place
)
# When iterable mode, set set_sample_list_generator(reader, place)
loader
.
set_sample_list_generator
(
reader
)
exe
.
run
(
startup_prog
)
exe
.
run
(
startup_prog
)
if
cfg
.
weights
:
if
cfg
.
weights
:
...
...
tools/train.py
浏览文件 @
0d1721e6
...
@@ -146,7 +146,8 @@ def main():
...
@@ -146,7 +146,8 @@ def main():
eval_prog
=
eval_prog
.
clone
(
True
)
eval_prog
=
eval_prog
.
clone
(
True
)
eval_reader
=
create_reader
(
cfg
.
EvalReader
,
devices_num
=
1
)
eval_reader
=
create_reader
(
cfg
.
EvalReader
,
devices_num
=
1
)
eval_loader
.
set_sample_list_generator
(
eval_reader
,
place
)
# When iterable mode, set set_sample_list_generator(eval_reader, place)
eval_loader
.
set_sample_list_generator
(
eval_reader
)
# parse eval fetches
# parse eval fetches
extra_keys
=
[]
extra_keys
=
[]
...
@@ -206,7 +207,8 @@ def main():
...
@@ -206,7 +207,8 @@ def main():
cfg
,
cfg
,
devices_num
=
devices_num
,
devices_num
=
devices_num
,
num_trainers
=
num_trainers
)
num_trainers
=
num_trainers
)
train_loader
.
set_sample_list_generator
(
train_reader
,
place
)
# When iterable mode, set set_sample_list_generator(train_reader, place)
train_loader
.
set_sample_list_generator
(
train_reader
)
# whether output bbox is normalized in model output layer
# whether output bbox is normalized in model output layer
is_bbox_normalized
=
False
is_bbox_normalized
=
False
...
...
tools/train_multi_machine.py
浏览文件 @
0d1721e6
...
@@ -162,7 +162,8 @@ def main():
...
@@ -162,7 +162,8 @@ def main():
eval_prog
=
eval_prog
.
clone
(
True
)
eval_prog
=
eval_prog
.
clone
(
True
)
eval_reader
=
create_reader
(
cfg
.
EvalReader
,
devices_num
=
1
)
eval_reader
=
create_reader
(
cfg
.
EvalReader
,
devices_num
=
1
)
eval_loader
.
set_sample_list_generator
(
eval_reader
,
place
)
# When iterable mode, set set_sample_list_generator(eval_reader, place)
eval_loader
.
set_sample_list_generator
(
eval_reader
)
# parse eval fetches
# parse eval fetches
extra_keys
=
[]
extra_keys
=
[]
...
@@ -200,7 +201,8 @@ def main():
...
@@ -200,7 +201,8 @@ def main():
cfg
.
TrainReader
,
(
cfg
.
max_iters
-
start_iter
)
*
devices_num
,
cfg
.
TrainReader
,
(
cfg
.
max_iters
-
start_iter
)
*
devices_num
,
cfg
,
cfg
,
devices_num
=
devices_num
)
devices_num
=
devices_num
)
train_loader
.
set_sample_list_generator
(
train_reader
,
place
)
# When iterable mode, set set_sample_list_generator(train_reader, place)
train_loader
.
set_sample_list_generator
(
train_reader
)
# whether output bbox is normalized in model output layer
# whether output bbox is normalized in model output layer
is_bbox_normalized
=
False
is_bbox_normalized
=
False
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录