Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
a26a6bc7
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a26a6bc7
编写于
1月 29, 2019
作者:
D
dzhwinter
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add flag. test=develop
上级
06f24488
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
0 deletion
+22
-0
python/paddle/fluid/framework.py
python/paddle/fluid/framework.py
+12
-0
python/paddle/fluid/io.py
python/paddle/fluid/io.py
+8
-0
python/paddle/fluid/transpiler/memory_optimization_transpiler.py
...paddle/fluid/transpiler/memory_optimization_transpiler.py
+2
-0
未找到文件。
python/paddle/fluid/framework.py
浏览文件 @
a26a6bc7
...
...
@@ -1725,6 +1725,18 @@ class Program(object):
self
.
_trainers_endpoints
=
[]
# the distributed lookup table names
self
.
_distributed_lookup_table
=
None
# whether the program is optimized by memory_optimize_transpiler
self
.
__is_optimized
=
False
@
property
def
_is_optimized
(
self
):
# if the program is optimized, operator input/outputs
# maybe same, which conflict with save_inference_model.
return
self
.
__is_optimized
@
_is_optimized
.
setter
def
set__is_optimized
(
self
,
target
):
self
.
__is_optimized
=
target
@
property
def
op_role
(
self
):
...
...
python/paddle/fluid/io.py
浏览文件 @
a26a6bc7
...
...
@@ -16,6 +16,7 @@ from __future__ import print_function
import
os
import
errno
import
warnings
import
time
import
shutil
import
six
...
...
@@ -930,6 +931,13 @@ def save_inference_model(dirname,
if
main_program
is
None
:
main_program
=
default_main_program
()
if
main_program
.
is_optimized
:
warnings
.
warn
(
"save_inference_model must put before you call memory_optimize.
\
the memory_optimize will modify the original program,
\
is not suitable for saving inference model
\
we save the original program as inference model."
,
RuntimeWarning
)
# when a pserver and a trainer running on the same machine, mkdir may conflict
try
:
...
...
python/paddle/fluid/transpiler/memory_optimization_transpiler.py
浏览文件 @
a26a6bc7
...
...
@@ -540,6 +540,7 @@ def memory_optimize(input_program,
if
skip_opt_set
is
not
None
:
skip_opt_set
=
set
(
map
(
to_name_str
,
skip_opt_set
))
cfgs
=
_get_cfgs
(
input_program
)
input_program
.
is_optimized
=
True
for
cfg
in
cfgs
:
cfg
.
memory_optimize
(
skip_opt_set
=
skip_opt_set
,
level
=
level
)
...
...
@@ -559,5 +560,6 @@ def release_memory(input_program, skip_opt_set=None):
None
"""
cfgs
=
_get_cfgs
(
input_program
)
input_program
.
is_optimized
=
True
for
cfg
in
cfgs
:
cfg
.
release_memory
(
skip_opt_set
=
skip_opt_set
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录