Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
069ae2d3
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,发现更多精彩内容 >>
提交
069ae2d3
编写于
8月 28, 2018
作者:
D
Dang Qingqing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Enable CE.
上级
ff63e48f
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
29 addition
and
39 deletion
+29
-39
fluid/image_classification/.run_ce.sh
fluid/image_classification/.run_ce.sh
+2
-2
fluid/image_classification/_ce.py
fluid/image_classification/_ce.py
+16
-16
fluid/image_classification/models/se_resnext.py
fluid/image_classification/models/se_resnext.py
+3
-6
fluid/image_classification/train.py
fluid/image_classification/train.py
+8
-15
未找到文件。
fluid/image_classification/.run_ce.sh
浏览文件 @
069ae2d3
...
...
@@ -4,8 +4,8 @@
export
FLAGS_cudnn_deterministic
=
True
cudaid
=
${
object_detection_cudaid
:
=0
}
export
CUDA_VISIBLE_DEVICES
=
$cudaid
python train.py
--batch_size
=
64
--num_epochs
=
10
--enable_ce
=
True
| python _ce.py
python train.py
--batch_size
=
64
--num_epochs
=
5
--enable_ce
=
True
--lr_strategy
=
cosine_decay
| python _ce.py
cudaid
=
${
object_detection_cudaid_m
:
=0, 1, 2, 3
}
export
CUDA_VISIBLE_DEVICES
=
$cudaid
python train.py
--batch_size
=
64
--num_epochs
=
10
--enable_ce
=
True
| python _ce.py
python train.py
--batch_size
=
64
--num_epochs
=
5
--enable_ce
=
True
--lr_strategy
=
cosine_decay
| python _ce.py
fluid/image_classification/_ce.py
浏览文件 @
069ae2d3
...
...
@@ -10,39 +10,39 @@ from kpi import CostKpi, DurationKpi, AccKpi
#### NOTE kpi.py should shared in models in some way!!!!
train_acc_top1_kpi
=
AccKpi
(
'train_acc_top1'
,
0.0
5
,
0
,
actived
=
Fals
e
,
desc
=
'TOP1 ACC'
)
'train_acc_top1'
,
0.0
2
,
0
,
actived
=
Tru
e
,
desc
=
'TOP1 ACC'
)
train_acc_top5_kpi
=
AccKpi
(
'train_acc_top5'
,
0.0
5
,
0
,
actived
=
Fals
e
,
desc
=
'TOP5 ACC'
)
train_cost_kpi
=
CostKpi
(
'train_cost'
,
0.
5
,
0
,
actived
=
Fals
e
,
desc
=
'train cost'
)
'train_acc_top5'
,
0.0
2
,
0
,
actived
=
Tru
e
,
desc
=
'TOP5 ACC'
)
train_cost_kpi
=
CostKpi
(
'train_cost'
,
0.
02
,
0
,
actived
=
Tru
e
,
desc
=
'train cost'
)
test_acc_top1_kpi
=
AccKpi
(
'test_acc_top1'
,
0.0
5
,
0
,
actived
=
Fals
e
,
desc
=
'TOP1 ACC'
)
'test_acc_top1'
,
0.0
2
,
0
,
actived
=
Tru
e
,
desc
=
'TOP1 ACC'
)
test_acc_top5_kpi
=
AccKpi
(
'test_acc_top5'
,
0.0
5
,
0
,
actived
=
Fals
e
,
desc
=
'TOP5 ACC'
)
test_cost_kpi
=
CostKpi
(
'test_cost'
,
0.
5
,
0
,
actived
=
Fals
e
,
desc
=
'train cost'
)
'test_acc_top5'
,
0.0
2
,
0
,
actived
=
Tru
e
,
desc
=
'TOP5 ACC'
)
test_cost_kpi
=
CostKpi
(
'test_cost'
,
0.
02
,
0
,
actived
=
Tru
e
,
desc
=
'train cost'
)
train_speed_kpi
=
AccKpi
(
'train_speed'
,
0.5
,
0.
0
5
,
0
,
actived
=
Fals
e
,
actived
=
Tru
e
,
unit_repr
=
'seconds/image'
,
desc
=
'train speed in one GPU card'
)
train_acc_top1_card4_kpi
=
AccKpi
(
'train_acc_top1_card4'
,
0.0
5
,
0
,
actived
=
Fals
e
,
desc
=
'TOP1 ACC'
)
'train_acc_top1_card4'
,
0.0
2
,
0
,
actived
=
Tru
e
,
desc
=
'TOP1 ACC'
)
train_acc_top5_card4_kpi
=
AccKpi
(
'train_acc_top5_card4'
,
0.0
5
,
0
,
actived
=
Fals
e
,
desc
=
'TOP5 ACC'
)
'train_acc_top5_card4'
,
0.0
2
,
0
,
actived
=
Tru
e
,
desc
=
'TOP5 ACC'
)
train_cost_card4_kpi
=
CostKpi
(
'train_cost_card4'
,
0.
5
,
0
,
actived
=
Fals
e
,
desc
=
'train cost'
)
'train_cost_card4'
,
0.
02
,
0
,
actived
=
Tru
e
,
desc
=
'train cost'
)
test_acc_top1_card4_kpi
=
AccKpi
(
'test_acc_top1_card4'
,
0.0
5
,
0
,
actived
=
Fals
e
,
desc
=
'TOP1 ACC'
)
'test_acc_top1_card4'
,
0.0
2
,
0
,
actived
=
Tru
e
,
desc
=
'TOP1 ACC'
)
test_acc_top5_card4_kpi
=
AccKpi
(
'test_acc_top5_card4'
,
0.0
5
,
0
,
actived
=
Fals
e
,
desc
=
'TOP5 ACC'
)
'test_acc_top5_card4'
,
0.0
2
,
0
,
actived
=
Tru
e
,
desc
=
'TOP5 ACC'
)
test_cost_card4_kpi
=
CostKpi
(
'test_cost_card4'
,
0.
5
,
0
,
actived
=
Fals
e
,
desc
=
'train cost'
)
'test_cost_card4'
,
0.
02
,
0
,
actived
=
Tru
e
,
desc
=
'train cost'
)
train_speed_card4_kpi
=
AccKpi
(
'train_speed_card4'
,
0.5
,
0.
0
5
,
0
,
actived
=
Fals
e
,
actived
=
Tru
e
,
unit_repr
=
'seconds/image'
,
desc
=
'train speed in four GPU card'
)
tracking_kpis
=
[
...
...
fluid/image_classification/models/se_resnext.py
浏览文件 @
069ae2d3
...
...
@@ -14,7 +14,7 @@ train_parameters = {
"input_size"
:
[
3
,
224
,
224
],
"input_mean"
:
[
0.485
,
0.456
,
0.406
],
"input_std"
:
[
0.229
,
0.224
,
0.225
],
"
enable_ce"
:
Fals
e
,
"
dropout_seed"
:
Non
e
,
"learning_strategy"
:
{
"name"
:
"piecewise_decay"
,
"batch_size"
:
256
,
...
...
@@ -105,11 +105,8 @@ class SE_ResNeXt():
pool
=
fluid
.
layers
.
pool2d
(
input
=
conv
,
pool_size
=
7
,
pool_type
=
'avg'
,
global_pooling
=
True
)
# enable_ce is used for continuous evaluation to remove the randomness
if
self
.
params
[
"enable_ce"
]:
drop
=
pool
else
:
drop
=
fluid
.
layers
.
dropout
(
x
=
pool
,
dropout_prob
=
0.5
)
drop
=
fluid
.
layers
.
dropout
(
x
=
pool
,
dropout_prob
=
0.5
,
seed
=
self
.
params
[
'dropout_seed'
])
stdv
=
1.0
/
math
.
sqrt
(
drop
.
shape
[
1
]
*
1.0
)
out
=
fluid
.
layers
.
fc
(
input
=
drop
,
size
=
class_dim
,
...
...
fluid/image_classification/train.py
浏览文件 @
069ae2d3
...
...
@@ -108,7 +108,7 @@ def train(args):
if
args
.
enable_ce
:
assert
model_name
==
"SE_ResNeXt50_32x4d"
fluid
.
default_startup_program
().
random_seed
=
1000
model
.
params
[
"
enable_ce"
]
=
True
model
.
params
[
"
dropout_seed"
]
=
100
class_dim
=
102
if
model_name
==
"GoogleNet"
:
...
...
@@ -269,21 +269,14 @@ def train(args):
print
(
"kpis train_speed %s"
%
train_speed
)
else
:
# Use the mean cost/acc for training
print
(
"kpis train_cost_card%s %s"
%
(
gpu_nums
,
train_loss
))
print
(
"kpis train_acc_top1_card%s %s"
%
(
gpu_nums
,
train_acc1
))
print
(
"kpis train_acc_top5_card%s %s"
%
(
gpu_nums
,
train_acc5
))
print
(
"kpis train_cost_card%s %s"
%
(
gpu_nums
,
train_loss
))
print
(
"kpis train_acc_top1_card%s %s"
%
(
gpu_nums
,
train_acc1
))
print
(
"kpis train_acc_top5_card%s %s"
%
(
gpu_nums
,
train_acc5
))
# Use the mean cost/acc for testing
print
(
"kpis test_cost_card%s %s"
%
(
gpu_nums
,
test_loss
))
print
(
"kpis test_acc_top1_card%s %s"
%
(
gpu_nums
,
test_acc1
))
print
(
"kpis test_acc_top5_card%s %s"
%
(
gpu_nums
,
test_acc5
))
print
(
"kpis train_speed_card%s %s"
%
(
gpu_nums
,
train_speed
))
print
(
"kpis test_cost_card%s %s"
%
(
gpu_nums
,
test_loss
))
print
(
"kpis test_acc_top1_card%s %s"
%
(
gpu_nums
,
test_acc1
))
print
(
"kpis test_acc_top5_card%s %s"
%
(
gpu_nums
,
test_acc5
))
print
(
"kpis train_speed_card%s %s"
%
(
gpu_nums
,
train_speed
))
def
main
():
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录