未验证 提交 6d99842b 编写于 作者: B Bai Yifan 提交者: GitHub

fix mean_iou api example, test=develop, test=document_preview (#19503)

Fix mean_iou api misleading example
上级 02270b3e
......@@ -197,7 +197,7 @@ paddle.fluid.layers.gather (ArgSpec(args=['input', 'index', 'overwrite'], vararg
paddle.fluid.layers.scatter (ArgSpec(args=['input', 'index', 'updates', 'name', 'overwrite'], varargs=None, keywords=None, defaults=(None, True)), ('document', '69b22affd4a6326502af166f04c095ab'))
paddle.fluid.layers.sequence_scatter (ArgSpec(args=['input', 'index', 'updates', 'name'], varargs=None, keywords=None, defaults=(None,)), ('document', 'abe3f714120117a5a3d3e639853932bf'))
paddle.fluid.layers.random_crop (ArgSpec(args=['x', 'shape', 'seed'], varargs=None, keywords=None, defaults=(None,)), ('document', '042af0b8abea96b40c22f6e70d99e042'))
paddle.fluid.layers.mean_iou (ArgSpec(args=['input', 'label', 'num_classes'], varargs=None, keywords=None, defaults=None), ('document', 'e3b6630ba43cb13dfeeb1601cb64d671'))
paddle.fluid.layers.mean_iou (ArgSpec(args=['input', 'label', 'num_classes'], varargs=None, keywords=None, defaults=None), ('document', 'e714b4aa7993dfe9c1a38886875dbaac'))
paddle.fluid.layers.relu (ArgSpec(args=['x', 'name'], varargs=None, keywords=None, defaults=(None,)), ('document', '0942c174f4f6fb274976d4357356f6a2'))
paddle.fluid.layers.selu (ArgSpec(args=['x', 'scale', 'alpha', 'name'], varargs=None, keywords=None, defaults=(None, None, None)), ('document', 'f93c61f5b0bf933cd425a64dca2c4fdd'))
paddle.fluid.layers.log (ArgSpec(args=['x', 'name'], varargs=None, keywords=None, defaults=(None,)), ('document', '02f668664e3bfc4df6c00d7363467140'))
......
......@@ -8760,10 +8760,12 @@ def mean_iou(input, label, num_classes):
.. code-block:: python
import paddle.fluid as fluid
predict = fluid.layers.data(name='predict', shape=[3, 32, 32])
label = fluid.layers.data(name='label', shape=[1])
iou_shape = [32, 32]
num_classes = 5
predict = fluid.layers.data(name='predict', shape=iou_shape)
label = fluid.layers.data(name='label', shape=iou_shape)
iou, wrongs, corrects = fluid.layers.mean_iou(predict, label,
num_classes=5)
num_classes)
"""
helper = LayerHelper('mean_iou', **locals())
dtype = helper.input_dtype()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册