Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
6f772ada
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6f772ada
编写于
8月 09, 2018
作者:
W
wanghaoshuang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix ce of icnet.
上级
386b9ce9
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
10 addition
and
11 deletion
+10
-11
fluid/icnet/.run_ce.sh
fluid/icnet/.run_ce.sh
+4
-3
fluid/icnet/_ce.py
fluid/icnet/_ce.py
+0
-2
fluid/icnet/eval.py
fluid/icnet/eval.py
+3
-3
fluid/icnet/icnet.py
fluid/icnet/icnet.py
+2
-2
fluid/icnet/train.py
fluid/icnet/train.py
+1
-1
未找到文件。
fluid/icnet/.run_ce.sh
浏览文件 @
6f772ada
#!/bin/bash
# This file is only used for continuous evaluation.
rm
-rf
./ck
mkdir
ck
python train.py
--use_gpu
=
True
--checkpoint_path
=
"./ck"
;
python eval.py
--model_path
=
"./ck/100"
| python _ce.py
rm
-rf
*
_factor.txt
python train.py
--use_gpu
=
True 1> log
cat
log | python _ce.py
fluid/icnet/_ce.py
浏览文件 @
6f772ada
...
...
@@ -8,12 +8,10 @@ from kpi import CostKpi, DurationKpi, AccKpi
# NOTE kpi.py should shared in models in some way!!!!
train_cost_kpi
=
CostKpi
(
'train_cost'
,
0.02
,
actived
=
True
)
test_acc_kpi
=
AccKpi
(
'test_acc'
,
0.005
,
actived
=
True
)
train_duration_kpi
=
DurationKpi
(
'train_duration'
,
0.06
,
actived
=
True
)
tracking_kpis
=
[
train_cost_kpi
,
test_acc_kpi
,
train_duration_kpi
,
]
...
...
fluid/icnet/eval.py
浏览文件 @
6f772ada
...
...
@@ -20,12 +20,12 @@ add_arg('use_gpu', bool, True, "Whether use GPU to test.")
def
cal_mean_iou
(
wrong
,
correct
):
sum
=
wrong
+
c
erro
ct
sum
=
wrong
+
c
orre
ct
true_num
=
(
sum
!=
0
).
sum
()
for
i
in
len
(
sum
):
for
i
in
range
(
len
(
sum
)
):
if
sum
[
i
]
==
0
:
sum
[
i
]
=
1
return
(
c
erro
ct
.
astype
(
"float64"
)
/
sum
).
sum
()
/
true_num
return
(
c
orre
ct
.
astype
(
"float64"
)
/
sum
).
sum
()
/
true_num
def
create_iou
(
predict
,
label
,
mask
,
num_classes
,
image_shape
):
...
...
fluid/icnet/icnet.py
浏览文件 @
6f772ada
...
...
@@ -184,7 +184,7 @@ def res_block(input, filter_num, padding=0, dilation=None, name=None):
tmp
=
conv
(
tmp
,
1
,
1
,
filter_num
,
1
,
1
,
name
=
name
+
"_1_1_increase"
)
tmp
=
bn
(
tmp
,
relu
=
False
)
tmp
=
input
+
tmp
tmp
=
fluid
.
layers
.
relu
(
tmp
,
name
=
name
+
"_relu"
)
tmp
=
fluid
.
layers
.
relu
(
tmp
)
return
tmp
...
...
@@ -227,7 +227,7 @@ def proj_block(input, filter_num, padding=0, dilation=None, stride=1,
tmp
=
conv
(
tmp
,
1
,
1
,
filter_num
,
1
,
1
,
name
=
name
+
"_1_1_increase"
)
tmp
=
bn
(
tmp
,
relu
=
False
)
tmp
=
proj_bn
+
tmp
tmp
=
fluid
.
layers
.
relu
(
tmp
,
name
=
name
+
"_relu"
)
tmp
=
fluid
.
layers
.
relu
(
tmp
)
return
tmp
...
...
fluid/icnet/train.py
浏览文件 @
6f772ada
...
...
@@ -130,7 +130,7 @@ def train(args):
sub124_loss
=
0.
sys
.
stdout
.
flush
()
if
iter_id
%
CHECKPOINT_PERIOD
==
0
:
if
iter_id
%
CHECKPOINT_PERIOD
==
0
and
args
.
checkpoint_path
is
not
None
:
dir_name
=
args
.
checkpoint_path
+
"/"
+
str
(
iter_id
)
fluid
.
io
.
save_persistables
(
exe
,
dirname
=
dir_name
)
print
"Saved checkpoint: %s"
%
(
dir_name
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录