Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_41840029
PaddleOCR
提交
aa3266b1
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看板
提交
aa3266b1
编写于
11月 04, 2020
作者:
Y
yukavio
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update for enable static
上级
e66b53ca
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
32 addition
and
3 deletion
+32
-3
deploy/slim/prune/export_prune_model.py
deploy/slim/prune/export_prune_model.py
+7
-0
deploy/slim/prune/pruning_and_finetune.py
deploy/slim/prune/pruning_and_finetune.py
+6
-1
deploy/slim/prune/sensitivity_anal.py
deploy/slim/prune/sensitivity_anal.py
+7
-0
deploy/slim/quantization/export_model.py
deploy/slim/quantization/export_model.py
+6
-1
deploy/slim/quantization/quant.py
deploy/slim/quantization/quant.py
+6
-1
未找到文件。
deploy/slim/prune/export_prune_model.py
浏览文件 @
aa3266b1
...
@@ -24,6 +24,7 @@ sys.path.append(os.path.join(__dir__, '..', '..', '..'))
...
@@ -24,6 +24,7 @@ sys.path.append(os.path.join(__dir__, '..', '..', '..'))
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
'..'
,
'..'
,
'..'
,
'tools'
))
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
'..'
,
'..'
,
'..'
,
'tools'
))
import
program
import
program
import
paddle
from
paddle
import
fluid
from
paddle
import
fluid
from
ppocr.utils.utility
import
initial_logger
from
ppocr.utils.utility
import
initial_logger
logger
=
initial_logger
()
logger
=
initial_logger
()
...
@@ -32,6 +33,12 @@ from paddleslim.prune import load_model
...
@@ -32,6 +33,12 @@ from paddleslim.prune import load_model
def
main
():
def
main
():
# Run code with static graph mode.
try
:
paddle
.
enable_static
()
except
:
pass
startup_prog
,
eval_program
,
place
,
config
,
_
=
program
.
preprocess
()
startup_prog
,
eval_program
,
place
,
config
,
_
=
program
.
preprocess
()
feeded_var_names
,
target_vars
,
fetches_var_name
=
program
.
build_export
(
feeded_var_names
,
target_vars
,
fetches_var_name
=
program
.
build_export
(
...
...
deploy/slim/prune/pruning_and_finetune.py
浏览文件 @
aa3266b1
...
@@ -50,7 +50,12 @@ skip_list = [
...
@@ -50,7 +50,12 @@ skip_list = [
def
main
():
def
main
():
paddle
.
enable_static
()
# Run code with static graph mode.
try
:
paddle
.
enable_static
()
except
:
pass
config
=
program
.
load_config
(
FLAGS
.
config
)
config
=
program
.
load_config
(
FLAGS
.
config
)
program
.
merge_config
(
FLAGS
.
opt
)
program
.
merge_config
(
FLAGS
.
opt
)
logger
.
info
(
config
)
logger
.
info
(
config
)
...
...
deploy/slim/prune/sensitivity_anal.py
浏览文件 @
aa3266b1
...
@@ -25,6 +25,7 @@ sys.path.append(os.path.join(__dir__, '..', '..', '..', 'tools'))
...
@@ -25,6 +25,7 @@ sys.path.append(os.path.join(__dir__, '..', '..', '..', 'tools'))
import
json
import
json
import
cv2
import
cv2
import
paddle
from
paddle
import
fluid
from
paddle
import
fluid
import
paddleslim
as
slim
import
paddleslim
as
slim
from
copy
import
deepcopy
from
copy
import
deepcopy
...
@@ -60,6 +61,12 @@ def eval_function(eval_args, mode='eval'):
...
@@ -60,6 +61,12 @@ def eval_function(eval_args, mode='eval'):
def
main
():
def
main
():
# Run code with static graph mode.
try
:
paddle
.
enable_static
()
except
:
pass
config
=
program
.
load_config
(
FLAGS
.
config
)
config
=
program
.
load_config
(
FLAGS
.
config
)
program
.
merge_config
(
FLAGS
.
opt
)
program
.
merge_config
(
FLAGS
.
opt
)
logger
.
info
(
config
)
logger
.
info
(
config
)
...
...
deploy/slim/quantization/export_model.py
浏览文件 @
aa3266b1
...
@@ -77,7 +77,12 @@ def main():
...
@@ -77,7 +77,12 @@ def main():
# The decay coefficient of moving average, default is 0.9
# The decay coefficient of moving average, default is 0.9
'moving_rate'
:
0.9
,
'moving_rate'
:
0.9
,
}
}
paddle
.
enable_static
()
# Run code with static graph mode.
try
:
paddle
.
enable_static
()
except
:
pass
startup_prog
,
eval_program
,
place
,
config
,
alg_type
=
program
.
preprocess
()
startup_prog
,
eval_program
,
place
,
config
,
alg_type
=
program
.
preprocess
()
feeded_var_names
,
target_vars
,
fetches_var_name
=
program
.
build_export
(
feeded_var_names
,
target_vars
,
fetches_var_name
=
program
.
build_export
(
...
...
deploy/slim/quantization/quant.py
浏览文件 @
aa3266b1
...
@@ -85,7 +85,12 @@ def get_optimizer():
...
@@ -85,7 +85,12 @@ def get_optimizer():
def
main
():
def
main
():
paddle
.
enable_static
()
# Run code with static graph mode.
try
:
paddle
.
enable_static
()
except
:
pass
train_build_outputs
=
program
.
build
(
train_build_outputs
=
program
.
build
(
config
,
train_program
,
startup_program
,
mode
=
'train'
)
config
,
train_program
,
startup_program
,
mode
=
'train'
)
train_loader
=
train_build_outputs
[
0
]
train_loader
=
train_build_outputs
[
0
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录