Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
c7a63908
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
c7a63908
编写于
6月 12, 2020
作者:
L
Leo Chen
提交者:
GitHub
6月 12, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
replace some logging.warn() with warings.warn(), test=develop (#25025)
上级
ab5a1fb8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
11 deletion
+12
-11
python/paddle/fluid/layers/math_op_patch.py
python/paddle/fluid/layers/math_op_patch.py
+2
-2
python/paddle/fluid/reader.py
python/paddle/fluid/reader.py
+10
-9
未找到文件。
python/paddle/fluid/layers/math_op_patch.py
浏览文件 @
c7a63908
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
from
__future__
import
print_function
from
__future__
import
print_function
import
logging
import
warnings
import
inspect
import
inspect
from
..
import
core
from
..
import
core
...
@@ -268,7 +268,7 @@ def monkey_patch_variable():
...
@@ -268,7 +268,7 @@ def monkey_patch_variable():
stack
=
inspect
.
stack
()[
1
]
stack
=
inspect
.
stack
()[
1
]
file_name
=
stack
[
1
]
file_name
=
stack
[
1
]
line_num
=
stack
[
2
]
line_num
=
stack
[
2
]
logging
.
warning
(
warnings
.
warn
(
"%s:%s
\n
The behavior of expression %s has been unified with %s(X, Y, axis=-1) from Paddle 2.0. "
"%s:%s
\n
The behavior of expression %s has been unified with %s(X, Y, axis=-1) from Paddle 2.0. "
"If your code works well in the older versions but crashes in this version, try to use "
"If your code works well in the older versions but crashes in this version, try to use "
"%s(X, Y, axis=0) instead of %s. This transitional warning will be dropped in the future."
"%s(X, Y, axis=0) instead of %s. This transitional warning will be dropped in the future."
...
...
python/paddle/fluid/reader.py
浏览文件 @
c7a63908
...
@@ -27,6 +27,7 @@ from .dataloader.dataloader_iter import _DataLoaderIterSingleProcess, _DataLoade
...
@@ -27,6 +27,7 @@ from .dataloader.dataloader_iter import _DataLoaderIterSingleProcess, _DataLoade
from
.layers.io
import
monkey_patch_reader_methods
,
_copy_reader_var_
,
double_buffer
from
.layers.io
import
monkey_patch_reader_methods
,
_copy_reader_var_
,
double_buffer
from
.unique_name
import
UniqueNameGenerator
from
.unique_name
import
UniqueNameGenerator
import
logging
import
logging
import
warnings
from
.dataset
import
DatasetBase
,
InMemoryDataset
from
.dataset
import
DatasetBase
,
InMemoryDataset
### Dygraph DataLoader configs ###
### Dygraph DataLoader configs ###
...
@@ -313,9 +314,9 @@ class DataLoader(object):
...
@@ -313,9 +314,9 @@ class DataLoader(object):
assert
num_workers
>=
0
,
"num_workers should be a non-negative value"
assert
num_workers
>=
0
,
"num_workers should be a non-negative value"
if
num_workers
>
0
and
(
sys
.
platform
==
'darwin'
or
if
num_workers
>
0
and
(
sys
.
platform
==
'darwin'
or
sys
.
platform
==
'win32'
):
sys
.
platform
==
'win32'
):
logging
.
warning
(
warnings
.
warn
(
"
multi-process mode not support
MacOs and Windows currently."
\
"
DataLoader with multi-process mode is not supported on
MacOs and Windows currently."
\
"
use signle-process
with num_workers = 0 instead"
)
"
Please use signle-process mode
with num_workers = 0 instead"
)
num_workers
=
0
num_workers
=
0
self
.
num_workers
=
num_workers
self
.
num_workers
=
num_workers
...
@@ -670,13 +671,13 @@ class DygraphGeneratorLoader(DataLoaderBase):
...
@@ -670,13 +671,13 @@ class DygraphGeneratorLoader(DataLoaderBase):
self
.
_use_double_buffer
=
use_double_buffer
self
.
_use_double_buffer
=
use_double_buffer
if
not
iterable
:
if
not
iterable
:
logging
.
warning
(
warnings
.
warn
(
"Please NOTE:
imperative mode can support
iterable mode only. Change to iterable mode."
"Please NOTE:
DygraphGeneratorLoader supports
iterable mode only. Change to iterable mode."
)
)
self
.
_iterable
=
True
self
.
_iterable
=
True
if
not
return_list
:
if
not
return_list
:
logging
.
warning
(
warnings
.
warn
(
"Please NOTE:
imperative mode can support return
as list only. Change to return as list."
"Please NOTE:
DygraphGeneratorLoader supports returning
as list only. Change to return as list."
)
)
self
.
_return_list
=
True
self
.
_return_list
=
True
...
@@ -684,8 +685,8 @@ class DygraphGeneratorLoader(DataLoaderBase):
...
@@ -684,8 +685,8 @@ class DygraphGeneratorLoader(DataLoaderBase):
self
.
_use_multiprocess
=
use_multiprocess
self
.
_use_multiprocess
=
use_multiprocess
if
self
.
_use_multiprocess
and
(
sys
.
platform
==
'darwin'
or
if
self
.
_use_multiprocess
and
(
sys
.
platform
==
'darwin'
or
sys
.
platform
==
'win32'
):
sys
.
platform
==
'win32'
):
logging
.
warning
(
warnings
.
warn
(
"NOTE:
The multiprocess mode does not currently support
MacOs and Windows."
"NOTE:
DygraphGeneratorLoader with multiprocess mode is not currently supported on
MacOs and Windows."
)
)
self
.
_use_multiprocess
=
False
self
.
_use_multiprocess
=
False
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录