Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleOCR
提交
f5692c3f
P
PaddleOCR
项目概览
s920243400
/
PaddleOCR
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleOCR
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
f5692c3f
编写于
8月 09, 2022
作者:
A
andyjpaddle
提交者:
GitHub
8月 09, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7143 from WenmuZhou/tttt
fix bug in amp eval
上级
6445362f
3bed2e1f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
10 deletion
+24
-10
test_tipc/configs/det_r50_dcn_fce_ctw_v2_0/det_r50_vd_dcn_fce_ctw.yml
...nfigs/det_r50_dcn_fce_ctw_v2_0/det_r50_vd_dcn_fce_ctw.yml
+1
-1
test_tipc/configs/layoutxlm_ser/train_infer_python.txt
test_tipc/configs/layoutxlm_ser/train_infer_python.txt
+2
-2
tools/program.py
tools/program.py
+21
-7
未找到文件。
test_tipc/configs/det_r50_dcn_fce_ctw_v2_0/det_r50_vd_dcn_fce_ctw.yml
浏览文件 @
f5692c3f
...
@@ -8,7 +8,7 @@ Global:
...
@@ -8,7 +8,7 @@ Global:
# evaluation is run every 835 iterations
# evaluation is run every 835 iterations
eval_batch_step
:
[
0
,
4000
]
eval_batch_step
:
[
0
,
4000
]
cal_metric_during_train
:
False
cal_metric_during_train
:
False
pretrained_model
:
./pretrain_models/ResNet50_vd_ssld_pretrained
pretrained_model
:
pretrain_models/det_r50_dcn_fce_ctw_v2.0_train/best_accuracy.pdparams
checkpoints
:
checkpoints
:
save_inference_dir
:
save_inference_dir
:
use_visualdl
:
False
use_visualdl
:
False
...
...
test_tipc/configs/layoutxlm_ser/train_infer_python.txt
浏览文件 @
f5692c3f
...
@@ -13,7 +13,7 @@ train_infer_img_dir:ppstructure/docs/vqa/input/zh_val_42.jpg
...
@@ -13,7 +13,7 @@ train_infer_img_dir:ppstructure/docs/vqa/input/zh_val_42.jpg
null:null
null:null
##
##
trainer:norm_train
trainer:norm_train
norm_train:tools/train.py -c configs/
vqa/ser/layoutx
lm_xfund_zh.yml -o Global.print_batch_step=1 Global.eval_batch_step=[1000,1000] Train.loader.shuffle=false
norm_train:tools/train.py -c configs/
kie/layoutlm_series/ser_layout
lm_xfund_zh.yml -o Global.print_batch_step=1 Global.eval_batch_step=[1000,1000] Train.loader.shuffle=false
pact_train:null
pact_train:null
fpgm_train:null
fpgm_train:null
distill_train:null
distill_train:null
...
@@ -27,7 +27,7 @@ null:null
...
@@ -27,7 +27,7 @@ null:null
===========================infer_params===========================
===========================infer_params===========================
Global.save_inference_dir:./output/
Global.save_inference_dir:./output/
Architecture.Backbone.checkpoints:
Architecture.Backbone.checkpoints:
norm_export:tools/export_model.py -c configs/
vqa/ser/layoutx
lm_xfund_zh.yml -o
norm_export:tools/export_model.py -c configs/
kie/layoutlm_series/ser_layout
lm_xfund_zh.yml -o
quant_export:
quant_export:
fpgm_export:
fpgm_export:
distill_export:null
distill_export:null
...
...
tools/program.py
浏览文件 @
f5692c3f
...
@@ -372,7 +372,8 @@ def train(config,
...
@@ -372,7 +372,8 @@ def train(config,
post_process_class
,
post_process_class
,
eval_class
,
eval_class
,
model_type
,
model_type
,
extra_input
=
extra_input
)
extra_input
=
extra_input
,
scaler
=
scaler
)
cur_metric_str
=
'cur metric, {}'
.
format
(
', '
.
join
(
cur_metric_str
=
'cur metric, {}'
.
format
(
', '
.
join
(
[
'{}: {}'
.
format
(
k
,
v
)
for
k
,
v
in
cur_metric
.
items
()]))
[
'{}: {}'
.
format
(
k
,
v
)
for
k
,
v
in
cur_metric
.
items
()]))
logger
.
info
(
cur_metric_str
)
logger
.
info
(
cur_metric_str
)
...
@@ -462,7 +463,8 @@ def eval(model,
...
@@ -462,7 +463,8 @@ def eval(model,
post_process_class
,
post_process_class
,
eval_class
,
eval_class
,
model_type
=
None
,
model_type
=
None
,
extra_input
=
False
):
extra_input
=
False
,
scaler
=
None
):
model
.
eval
()
model
.
eval
()
with
paddle
.
no_grad
():
with
paddle
.
no_grad
():
total_frame
=
0.0
total_frame
=
0.0
...
@@ -479,12 +481,24 @@ def eval(model,
...
@@ -479,12 +481,24 @@ def eval(model,
break
break
images
=
batch
[
0
]
images
=
batch
[
0
]
start
=
time
.
time
()
start
=
time
.
time
()
if
model_type
==
'table'
or
extra_input
:
preds
=
model
(
images
,
data
=
batch
[
1
:])
# use amp
elif
model_type
in
[
"kie"
,
'vqa'
]:
if
scaler
:
preds
=
model
(
batch
)
with
paddle
.
amp
.
auto_cast
(
level
=
'O2'
):
if
model_type
==
'table'
or
extra_input
:
preds
=
model
(
images
,
data
=
batch
[
1
:])
elif
model_type
in
[
"kie"
,
'vqa'
]:
preds
=
model
(
batch
)
else
:
preds
=
model
(
images
)
else
:
else
:
preds
=
model
(
images
)
if
model_type
==
'table'
or
extra_input
:
preds
=
model
(
images
,
data
=
batch
[
1
:])
elif
model_type
in
[
"kie"
,
'vqa'
]:
preds
=
model
(
batch
)
else
:
preds
=
model
(
images
)
batch_numpy
=
[]
batch_numpy
=
[]
for
item
in
batch
:
for
item
in
batch
:
if
isinstance
(
item
,
paddle
.
Tensor
):
if
isinstance
(
item
,
paddle
.
Tensor
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录