Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
189e10f1
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
189e10f1
编写于
9月 16, 2020
作者:
L
Leo Chen
提交者:
GitHub
9月 16, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unnecessary requirements (#27341)
* remove objgraph * remove graphviz * fix ut
上级
11bcf0e2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
0 addition
and
98 deletion
+0
-98
python/paddle/fluid/dygraph/base.py
python/paddle/fluid/dygraph/base.py
+0
-19
python/paddle/fluid/tests/unittests/CMakeLists.txt
python/paddle/fluid/tests/unittests/CMakeLists.txt
+0
-2
python/paddle/fluid/tests/unittests/test_imperative_debug_string.py
...dle/fluid/tests/unittests/test_imperative_debug_string.py
+0
-75
python/requirements.txt
python/requirements.txt
+0
-2
未找到文件。
python/paddle/fluid/dygraph/base.py
浏览文件 @
189e10f1
...
...
@@ -23,7 +23,6 @@ from paddle.fluid import framework
from
paddle.fluid.multiprocess_utils
import
CleanupFuncRegistrar
from
.tracer
import
Tracer
import
logging
import
objgraph
from
..data_feeder
import
convert_dtype
import
warnings
...
...
@@ -368,24 +367,6 @@ def guard(place=None):
yield
def
_print_debug_msg
(
parameter_list
,
limit
=
5
,
is_test
=
False
):
if
not
core
.
_is_dygraph_debug_enabled
():
logging
.
warn
(
'Debug mode is not enabled. Please set FLAGS_dygraph_debug=1 to enable debug'
)
return
unique_name_size
=
len
(
framework
.
unique_name
.
generator
.
ids
)
tracer_var_size
=
len
(
parameter_list
)
alive_cpp_var_size
=
len
(
core
.
VarBase
.
_alive_vars
())
if
not
is_test
:
logging
.
warn
(
'unique_name num: {}, tracer vars num: {}, alive cpp vars num: {}'
.
format
(
unique_name_size
,
tracer_var_size
,
alive_cpp_var_size
))
objgraph
.
show_growth
(
limit
=
limit
)
else
:
return
unique_name_size
,
tracer_var_size
,
alive_cpp_var_size
@
framework
.
dygraph_only
def
grad
(
outputs
,
inputs
,
...
...
python/paddle/fluid/tests/unittests/CMakeLists.txt
浏览文件 @
189e10f1
...
...
@@ -326,7 +326,6 @@ list(REMOVE_ITEM TEST_OPS test_basic_gru_api)
list
(
REMOVE_ITEM TEST_OPS test_basic_gru_unit_op
)
list
(
REMOVE_ITEM TEST_OPS test_basic_lstm_api
)
list
(
REMOVE_ITEM TEST_OPS test_basic_lstm_unit_op
)
list
(
REMOVE_ITEM TEST_OPS test_imperative_debug_string
)
list
(
REMOVE_ITEM TEST_OPS test_fuse_bn_act_pass
)
list
(
REMOVE_ITEM TEST_OPS test_imperative_static_runner_mnist
)
list
(
REMOVE_ITEM TEST_OPS test_imperative_static_runner_while
)
...
...
@@ -416,7 +415,6 @@ py_test_modules(test_imperative_ocr_attention_model MODULES test_imperative_ocr_
py_test_modules
(
test_install_check MODULES test_install_check ENVS
FLAGS_cudnn_deterministic=1 SERIAL
)
set_tests_properties
(
test_install_check PROPERTIES LABELS
"RUN_TYPE=DIST"
)
py_test_modules
(
test_imperative_debug_string MODULES test_imperative_debug_string ENVS FLAGS_dygraph_debug=1
)
py_test_modules
(
test_imperative_static_runner_mnist MODULES test_imperative_static_runner_mnist ENVS
FLAGS_cudnn_deterministic=1
)
py_test_modules
(
test_imperative_static_runner_while MODULES test_imperative_static_runner_while ENVS
...
...
python/paddle/fluid/tests/unittests/test_imperative_debug_string.py
已删除
100644 → 0
浏览文件 @
11bcf0e2
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from
__future__
import
print_function
import
unittest
import
paddle.fluid
as
fluid
import
numpy
as
np
class
MLP
(
fluid
.
Layer
):
def
__init__
(
self
,
input_size
):
super
(
MLP
,
self
).
__init__
()
self
.
_linear1
=
fluid
.
dygraph
.
Linear
(
input_size
,
3
,
param_attr
=
fluid
.
ParamAttr
(
initializer
=
fluid
.
initializer
.
Constant
(
value
=
0.1
)),
bias_attr
=
fluid
.
ParamAttr
(
initializer
=
fluid
.
initializer
.
Constant
(
value
=
0.1
)))
self
.
_linear2
=
fluid
.
dygraph
.
Linear
(
3
,
4
,
param_attr
=
fluid
.
ParamAttr
(
initializer
=
fluid
.
initializer
.
Constant
(
value
=
0.1
)),
bias_attr
=
fluid
.
ParamAttr
(
initializer
=
fluid
.
initializer
.
Constant
(
value
=
0.1
)))
def
forward
(
self
,
inputs
):
x
=
self
.
_linear1
(
inputs
)
x
=
self
.
_linear2
(
x
)
x
=
fluid
.
layers
.
reduce_sum
(
x
)
return
x
class
TestDygraphDebugString
(
unittest
.
TestCase
):
def
test_dygraph_debug_string
(
self
):
np_inp
=
np
.
array
([[
1.0
,
2.0
],
[
3.0
,
4.0
]],
dtype
=
np
.
float32
)
unique_name
=
0
trace_var
=
0
alive_var
=
0
with
fluid
.
dygraph
.
guard
():
mlp
=
MLP
(
input_size
=
2
)
for
i
in
range
(
10
):
var_inp
=
fluid
.
dygraph
.
base
.
to_variable
(
np_inp
)
out
=
mlp
(
var_inp
)
out
.
backward
()
mlp
.
clear_gradients
()
unique_name_tmp
,
trace_var_tmp
,
alive_var_tmp
=
fluid
.
dygraph
.
base
.
_print_debug_msg
(
mlp
.
parameters
(),
is_test
=
True
)
if
i
>
0
:
self
.
assertGreaterEqual
(
unique_name
,
unique_name_tmp
)
self
.
assertGreaterEqual
(
trace_var
,
trace_var_tmp
)
self
.
assertGreaterEqual
(
alive_var
,
alive_var_tmp
)
else
:
unique_name
=
unique_name_tmp
trace_var
=
trace_var_tmp
alive_var
=
alive_var_tmp
try
:
fluid
.
dygraph
.
base
.
_print_debug_msg
(
mlp
.
parameters
())
except
Exception
as
e
:
raise
RuntimeError
(
"No Exception is accepted in _print_debug_msg, but we got: {}"
.
format
(
e
))
python/requirements.txt
浏览文件 @
189e10f1
...
...
@@ -13,11 +13,9 @@ scipy ; python_version>"3.5"
nltk ; python_version>="3.5"
rarfile
Pillow
graphviz
six
decorator
prettytable
objgraph
astor
pathlib
netifaces
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录