Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
599e9e48
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看板
未验证
提交
599e9e48
编写于
6月 07, 2021
作者:
Z
zhangchunle
提交者:
GitHub
6月 07, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix too-many-format-args (#33353)
上级
cb12282e
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
18 addition
and
17 deletion
+18
-17
paddle/fluid/inference/tests/api/full_ILSVRC2012_val_preprocess.py
...uid/inference/tests/api/full_ILSVRC2012_val_preprocess.py
+2
-2
python/paddle/distributed/fleet/base/distributed_strategy.py
python/paddle/distributed/fleet/base/distributed_strategy.py
+1
-1
python/paddle/distributed/fleet/launch_utils.py
python/paddle/distributed/fleet/launch_utils.py
+1
-1
python/paddle/distributed/fleet/meta_optimizers/sharding/utils.py
...addle/distributed/fleet/meta_optimizers/sharding/utils.py
+2
-1
python/paddle/distributed/fleet/utils/fs.py
python/paddle/distributed/fleet/utils/fs.py
+1
-2
python/paddle/distributed/utils.py
python/paddle/distributed/utils.py
+1
-1
python/paddle/fluid/framework.py
python/paddle/fluid/framework.py
+3
-3
python/paddle/fluid/incubate/fleet/utils/hdfs.py
python/paddle/fluid/incubate/fleet/utils/hdfs.py
+1
-2
python/paddle/fluid/tests/test_beam_search_decoder.py
python/paddle/fluid/tests/test_beam_search_decoder.py
+1
-1
python/paddle/fluid/tests/unittests/test_traced_layer_err_msg.py
...paddle/fluid/tests/unittests/test_traced_layer_err_msg.py
+1
-1
python/paddle/vision/transforms/functional_cv2.py
python/paddle/vision/transforms/functional_cv2.py
+2
-1
python/paddle/vision/transforms/functional_pil.py
python/paddle/vision/transforms/functional_pil.py
+2
-1
未找到文件。
paddle/fluid/inference/tests/api/full_ILSVRC2012_val_preprocess.py
浏览文件 @
599e9e48
...
...
@@ -167,8 +167,8 @@ def run_convert():
os
.
path
.
getsize
(
output_file
)
==
FULL_SIZE_BYTES
):
if
os
.
path
.
exists
(
output_file
):
sys
.
stderr
.
write
(
"
\n\n
The existing binary file is broken. Start to generate new one...
\n\n
"
.
format
(
output_file
)
)
"
\n\n
The existing binary file is broken. Start to generate new one...
\n\n
"
)
os
.
remove
(
output_file
)
if
retry
<
try_limit
:
retry
=
retry
+
1
...
...
python/paddle/distributed/fleet/base/distributed_strategy.py
浏览文件 @
599e9e48
...
...
@@ -286,7 +286,7 @@ class DistributedStrategy(object):
self
.
a_sync_configs
=
{
"k_steps"
:
0
}
else
:
raise
ValueError
(
"The type of `flag` is invalid, expected type is bool, but received
%s
"
.
"The type of `flag` is invalid, expected type is bool, but received
{}
"
.
format
(
type
(
flag
)))
@
property
...
...
python/paddle/distributed/fleet/launch_utils.py
浏览文件 @
599e9e48
...
...
@@ -195,7 +195,7 @@ class Pod(object):
self
.
id
!=
pod
.
id
or
\
self
.
addr
!=
pod
.
addr
or
\
self
.
port
!=
pod
.
port
:
logger
.
debug
(
"pod {} !=
pod
"
.
format
(
self
,
pod
))
logger
.
debug
(
"pod {} !=
{}
"
.
format
(
self
,
pod
))
return
False
if
len
(
self
.
trainers
)
!=
len
(
pod
.
trainers
):
...
...
python/paddle/distributed/fleet/meta_optimizers/sharding/utils.py
浏览文件 @
599e9e48
...
...
@@ -368,7 +368,8 @@ def insert_reduce_ops(block,
for
var
in
reduce_vars
:
root_id
=
get_grad_device
(
var
,
shard
)
assert
root_id
>=
0
,
"root id should be a positive int"
.
format
(
var
)
assert
root_id
>=
0
,
"root id should be a positive int, but now root id is {}"
.
format
(
root_id
)
block
.
_insert_op_without_sync
(
insert_idx
,
type
=
'c_reduce_sum'
,
...
...
python/paddle/distributed/fleet/utils/fs.py
浏览文件 @
599e9e48
...
...
@@ -841,8 +841,7 @@ class HDFSClient(FS):
fs_src_path
))
if
self
.
is_exist
(
fs_dst_path
):
raise
FSFileExistsError
(
"{} exists already"
.
format
(
fs_src_path
,
fs_dst_path
,
fs_dst_path
))
raise
FSFileExistsError
(
"{} exists already"
.
format
(
fs_dst_path
))
return
self
.
_try_mv
(
fs_src_path
,
fs_dst_path
)
...
...
python/paddle/distributed/utils.py
浏览文件 @
599e9e48
...
...
@@ -264,7 +264,7 @@ class Pod(object):
self
.
id
!=
pod
.
id
or
\
self
.
addr
!=
pod
.
addr
or
\
self
.
port
!=
pod
.
port
:
logger
.
debug
(
"pod {} !=
pod
"
.
format
(
self
,
pod
))
logger
.
debug
(
"pod {} !=
{}
"
.
format
(
self
,
pod
))
return
False
if
len
(
self
.
trainers
)
!=
len
(
pod
.
trainers
):
...
...
python/paddle/fluid/framework.py
浏览文件 @
599e9e48
...
...
@@ -2142,7 +2142,7 @@ class Operator(object):
"""
assert
isinstance
(
skip_op_callstack
,
bool
),
"skip_op_callstack parameter's type is error, expect bool, received
%s
"
.
format
(
),
"skip_op_callstack parameter's type is error, expect bool, received
{}
"
.
format
(
type
(
skip_op_callstack
))
outputs_str
=
"{"
for
i
in
range
(
0
,
len
(
self
.
output_names
)):
...
...
@@ -2550,7 +2550,7 @@ class Block(object):
"""
assert
isinstance
(
skip_op_callstack
,
bool
),
"skip_op_callstack parameter's type is error, expect bool, received
%s
"
.
format
(
),
"skip_op_callstack parameter's type is error, expect bool, received
{}
"
.
format
(
type
(
skip_op_callstack
))
block_str
=
"{ // block "
block_str
+=
"{}
\n
"
.
format
(
self
.
idx
)
...
...
@@ -4259,7 +4259,7 @@ class Program(object):
"""
assert
isinstance
(
skip_op_callstack
,
bool
),
"skip_op_callstack parameter's type is error, expect bool, received
%s
"
.
format
(
),
"skip_op_callstack parameter's type is error, expect bool, received
{}
"
.
format
(
type
(
skip_op_callstack
))
program_str
=
""
for
block
in
self
.
blocks
:
...
...
python/paddle/fluid/incubate/fleet/utils/hdfs.py
浏览文件 @
599e9e48
...
...
@@ -268,8 +268,7 @@ class HDFSClient(FS):
fs_src_path
))
if
self
.
is_exist
(
fs_dst_path
):
raise
FSFileExistsError
(
"{} exists already"
.
format
(
fs_src_path
,
fs_dst_path
,
fs_dst_path
))
raise
FSFileExistsError
(
"{} exists already"
.
format
(
fs_dst_path
))
return
self
.
_try_mv
(
fs_src_path
,
fs_dst_path
)
...
...
python/paddle/fluid/tests/test_beam_search_decoder.py
浏览文件 @
599e9e48
...
...
@@ -246,7 +246,7 @@ def inject_test_train(use_cuda):
def
inject_test_decode
(
use_cuda
,
decorator
=
None
):
f_name
=
'test_{0}_decode'
.
format
(
'cuda'
if
use_cuda
else
'cpu'
,
'sparse'
)
f_name
=
'test_{0}_decode'
.
format
(
'cuda'
if
use_cuda
else
'cpu'
)
def
f
(
*
args
):
with
scope_prog_guard
():
...
...
python/paddle/fluid/tests/unittests/test_traced_layer_err_msg.py
浏览文件 @
599e9e48
...
...
@@ -72,7 +72,7 @@ class TestTracedLayerErrMsg(unittest.TestCase):
self
.
layer
,
3
)
self
.
assertEqual
(
"The type of 'each element of inputs' in fluid.dygraph.jit.TracedLayer.trace must be fluid.Variable, but received <{} 'int'>."
.
format
(
self
.
type_str
,
self
.
type_str
),
str
(
e
.
exception
))
format
(
self
.
type_str
),
str
(
e
.
exception
))
with
self
.
assertRaises
(
TypeError
)
as
e
:
dygraph_out
,
traced_layer
=
fluid
.
dygraph
.
TracedLayer
.
trace
(
self
.
layer
,
[
True
,
1
])
...
...
python/paddle/vision/transforms/functional_cv2.py
浏览文件 @
599e9e48
...
...
@@ -392,7 +392,8 @@ def adjust_hue(img, hue_factor):
cv2
=
try_import
(
'cv2'
)
if
not
(
-
0.5
<=
hue_factor
<=
0.5
):
raise
ValueError
(
'hue_factor is not in [-0.5, 0.5].'
.
format
(
hue_factor
))
raise
ValueError
(
'hue_factor:{} is not in [-0.5, 0.5].'
.
format
(
hue_factor
))
dtype
=
img
.
dtype
img
=
img
.
astype
(
np
.
uint8
)
...
...
python/paddle/vision/transforms/functional_pil.py
浏览文件 @
599e9e48
...
...
@@ -378,7 +378,8 @@ def adjust_hue(img, hue_factor):
"""
if
not
(
-
0.5
<=
hue_factor
<=
0.5
):
raise
ValueError
(
'hue_factor is not in [-0.5, 0.5].'
.
format
(
hue_factor
))
raise
ValueError
(
'hue_factor:{} is not in [-0.5, 0.5].'
.
format
(
hue_factor
))
input_mode
=
img
.
mode
if
input_mode
in
{
'L'
,
'1'
,
'I'
,
'F'
}:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录