未验证 提交 e08fdd16 编写于 作者: L LielinJiang 提交者: GitHub

Add option "verbose" for predict api (#33405)

* add option verbose for predict api
上级 291fc0f0
......@@ -1831,6 +1831,7 @@ class Model(object):
batch_size=1,
num_workers=0,
stack_outputs=False,
verbose=1,
callbacks=None):
"""
Compute the output predictions on testing data.
......@@ -1851,7 +1852,10 @@ class Model(object):
be a length N list in shape [[X, Y], [X, Y], ....[X, Y]] if stack_outputs
is False. stack_outputs as False is used for LoDTensor output situation,
it is recommended set as True if outputs contains no LoDTensor. Default: False.
verbose (int): The verbosity mode, should be 0, 1, or 2. 0 = silent,
1 = progress bar, 2 = one line per batch. Default: 1.
callbacks(Callback): A Callback instance, default None.
Returns:
list: output of models.
......@@ -1911,7 +1915,7 @@ class Model(object):
self._test_dataloader = test_loader
cbks = config_callbacks(callbacks, model=self, verbose=1)
cbks = config_callbacks(callbacks, model=self, verbose=verbose)
test_steps = self._len_data_loader(test_loader)
logs = {'steps': test_steps}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册