Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
67bd89a5
M
models
项目概览
PaddlePaddle
/
models
1 年多 前同步成功
通知
222
Star
6828
Fork
2962
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
602
列表
看板
标记
里程碑
合并请求
255
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
602
Issue
602
列表
看板
标记
里程碑
合并请求
255
合并请求
255
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
67bd89a5
编写于
7月 18, 2019
作者:
J
jerrywgz
提交者:
GitHub
7月 18, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix train+eval in PaddleDetection(#2847)
上级
64ce951d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
6 deletion
+12
-6
PaddleCV/PaddleDetection/configs/faster_rcnn_r50_fpn_1x.yml
PaddleCV/PaddleDetection/configs/faster_rcnn_r50_fpn_1x.yml
+1
-1
PaddleCV/PaddleDetection/ppdet/modeling/architectures/mask_rcnn.py
...PaddleDetection/ppdet/modeling/architectures/mask_rcnn.py
+5
-1
PaddleCV/PaddleDetection/tools/train.py
PaddleCV/PaddleDetection/tools/train.py
+6
-4
未找到文件。
PaddleCV/PaddleDetection/configs/faster_rcnn_r50_fpn_1x.yml
浏览文件 @
67bd89a5
...
...
@@ -9,7 +9,7 @@ log_smooth_window: 20
save_dir
:
output
pretrain_weights
:
https://paddle-imagenet-models-name.bj.bcebos.com/ResNet50_cos_pretrained.tar
metric
:
COCO
weights
:
output/f
pn/f
aster_rcnn_r50_fpn_1x/model_final
weights
:
output/faster_rcnn_r50_fpn_1x/model_final
num_classes
:
81
FasterRCNN
:
...
...
PaddleCV/PaddleDetection/ppdet/modeling/architectures/mask_rcnn.py
浏览文件 @
67bd89a5
...
...
@@ -149,7 +149,11 @@ class MaskRCNN(object):
cond
=
fluid
.
layers
.
less_than
(
x
=
bbox_size
,
y
=
size
)
mask_pred
=
fluid
.
layers
.
create_global_var
(
shape
=
[
1
],
value
=
0.0
,
dtype
=
'float32'
,
persistable
=
False
)
shape
=
[
1
],
value
=
0.0
,
dtype
=
'float32'
,
persistable
=
False
,
name
=
'mask_pred'
)
with
fluid
.
layers
.
control_flow
.
Switch
()
as
switch
:
with
switch
.
case
(
cond
):
...
...
PaddleCV/PaddleDetection/tools/train.py
浏览文件 @
67bd89a5
...
...
@@ -86,7 +86,6 @@ def main():
place
=
fluid
.
CUDAPlace
(
0
)
if
cfg
.
use_gpu
else
fluid
.
CPUPlace
()
exe
=
fluid
.
Executor
(
place
)
model
=
create
(
main_arch
)
lr_builder
=
create
(
'LearningRate'
)
optim_builder
=
create
(
'OptimizerBuilder'
)
...
...
@@ -95,6 +94,7 @@ def main():
train_prog
=
fluid
.
Program
()
with
fluid
.
program_guard
(
train_prog
,
startup_prog
):
with
fluid
.
unique_name
.
guard
():
model
=
create
(
main_arch
)
train_pyreader
,
feed_vars
=
create_feed
(
train_feed
)
train_fetches
=
model
.
train
(
feed_vars
)
loss
=
train_fetches
[
'loss'
]
...
...
@@ -113,6 +113,7 @@ def main():
eval_prog
=
fluid
.
Program
()
with
fluid
.
program_guard
(
eval_prog
,
startup_prog
):
with
fluid
.
unique_name
.
guard
():
model
=
create
(
main_arch
)
eval_pyreader
,
feed_vars
=
create_feed
(
eval_feed
)
fetches
=
model
.
eval
(
feed_vars
)
eval_prog
=
eval_prog
.
clone
(
True
)
...
...
@@ -120,8 +121,9 @@ def main():
eval_reader
=
create_reader
(
eval_feed
)
eval_pyreader
.
decorate_sample_list_generator
(
eval_reader
,
place
)
# parse train fetches
extra_keys
=
[
'im_info'
,
'im_id'
]
if
cfg
.
metric
==
'COCO'
else
[]
# parse eval fetches
extra_keys
=
[
'im_info'
,
'im_id'
,
'im_shape'
]
if
cfg
.
metric
==
'COCO'
else
[]
eval_keys
,
eval_values
,
eval_cls
=
parse_fetches
(
fetches
,
eval_prog
,
extra_keys
)
...
...
@@ -132,7 +134,7 @@ def main():
sync_bn
=
getattr
(
model
.
backbone
,
'norm_type'
,
None
)
==
'sync_bn'
# only enable sync_bn in multi GPU devices
build_strategy
.
sync_batch_norm
=
sync_bn
and
devices_num
>
1
\
and
cfg
.
use_gpu
and
cfg
.
use_gpu
train_compile_program
=
fluid
.
compiler
.
CompiledProgram
(
train_prog
).
with_data_parallel
(
loss_name
=
loss
.
name
,
build_strategy
=
build_strategy
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录