Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_41840029
PaddleOCR
提交
a3dee6a4
P
PaddleOCR
项目概览
weixin_41840029
/
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看板
提交
a3dee6a4
编写于
9月 16, 2020
作者:
Y
yukavio
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove env flags
上级
b8bf9b2c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
3 addition
and
43 deletion
+3
-43
deploy/slim/prune/export_prune_model.py
deploy/slim/prune/export_prune_model.py
+0
-14
deploy/slim/prune/pruning_and_finetune.py
deploy/slim/prune/pruning_and_finetune.py
+0
-14
deploy/slim/prune/sensitivity_anal.py
deploy/slim/prune/sensitivity_anal.py
+0
-14
tools/program.py
tools/program.py
+3
-1
未找到文件。
deploy/slim/prune/export_prune_model.py
浏览文件 @
a3dee6a4
...
...
@@ -23,20 +23,6 @@ sys.path.append(__dir__)
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
'..'
,
'..'
,
'..'
))
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
'..'
,
'..'
,
'..'
,
'tools'
))
def
set_paddle_flags
(
**
kwargs
):
for
key
,
value
in
kwargs
.
items
():
if
os
.
environ
.
get
(
key
,
None
)
is
None
:
os
.
environ
[
key
]
=
str
(
value
)
# NOTE(paddle-dev): All of these flags should be
# set before `import paddle`. Otherwise, it would
# not take any effect.
set_paddle_flags
(
FLAGS_eager_delete_tensor_gb
=
0
,
# enable GC to save memory
)
import
program
from
paddle
import
fluid
from
ppocr.utils.utility
import
initial_logger
...
...
deploy/slim/prune/pruning_and_finetune.py
浏览文件 @
a3dee6a4
...
...
@@ -24,20 +24,6 @@ sys.path.append(__dir__)
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
'..'
,
'..'
,
'..'
))
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
'..'
,
'..'
,
'..'
,
'tools'
))
def
set_paddle_flags
(
**
kwargs
):
for
key
,
value
in
kwargs
.
items
():
if
os
.
environ
.
get
(
key
,
None
)
is
None
:
os
.
environ
[
key
]
=
str
(
value
)
# NOTE(paddle-dev): All of these flags should be
# set before `import paddle`. Otherwise, it would
# not take any effect.
set_paddle_flags
(
FLAGS_eager_delete_tensor_gb
=
0
,
# enable GC to save memory
)
import
tools.program
as
program
from
paddle
import
fluid
from
ppocr.utils.utility
import
initial_logger
...
...
deploy/slim/prune/sensitivity_anal.py
浏览文件 @
a3dee6a4
...
...
@@ -23,20 +23,6 @@ sys.path.append(__dir__)
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
'..'
,
'..'
,
'..'
))
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
'..'
,
'..'
,
'..'
,
'tools'
))
def
set_paddle_flags
(
**
kwargs
):
for
key
,
value
in
kwargs
.
items
():
if
os
.
environ
.
get
(
key
,
None
)
is
None
:
os
.
environ
[
key
]
=
str
(
value
)
# NOTE(paddle-dev): All of these flags should be
# set before `import paddle`. Otherwise, it would
# not take any effect.
set_paddle_flags
(
FLAGS_eager_delete_tensor_gb
=
0
,
# enable GC to save memory
)
import
json
import
cv2
from
paddle
import
fluid
...
...
tools/program.py
浏览文件 @
a3dee6a4
...
...
@@ -33,7 +33,6 @@ from eval_utils.eval_rec_utils import eval_rec_run
from
ppocr.utils.save_load
import
save_model
import
numpy
as
np
from
ppocr.utils.character
import
cal_predicts_accuracy
,
cal_predicts_accuracy_srn
,
CharacterOps
import
paddleslim
as
slim
class
ArgsParser
(
ArgumentParser
):
...
...
@@ -300,6 +299,7 @@ def train_eval_det_run(config,
best_epoch
=
epoch
save_path
=
save_model_dir
+
"/best_accuracy"
if
is_pruning
:
import
paddleslim
as
slim
slim
.
prune
.
save_model
(
exe
,
train_info_dict
[
'train_program'
],
save_path
)
...
...
@@ -317,6 +317,7 @@ def train_eval_det_run(config,
if
epoch
==
0
and
save_epoch_step
==
1
:
save_path
=
save_model_dir
+
"/iter_epoch_0"
if
is_pruning
:
import
paddleslim
as
slim
slim
.
prune
.
save_model
(
exe
,
train_info_dict
[
'train_program'
],
save_path
)
else
:
...
...
@@ -324,6 +325,7 @@ def train_eval_det_run(config,
if
epoch
>
0
and
epoch
%
save_epoch_step
==
0
:
save_path
=
save_model_dir
+
"/iter_epoch_%d"
%
(
epoch
)
if
is_pruning
:
import
paddleslim
as
slim
slim
.
prune
.
save_model
(
exe
,
train_info_dict
[
'train_program'
],
save_path
)
else
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录