From d6f27f5a4a5cbb95cdfca590f024496b6e8e9d55 Mon Sep 17 00:00:00 2001 From: ms_yan <6576637+ms_yan@user.noreply.gitee.com> Date: Sat, 23 May 2020 16:06:27 +0800 Subject: [PATCH] repair parameter problem in Uniform augmentation --- mindspore/dataset/transforms/vision/c_transforms.py | 4 ++-- mindspore/dataset/transforms/vision/validators.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mindspore/dataset/transforms/vision/c_transforms.py b/mindspore/dataset/transforms/vision/c_transforms.py index 1806d2244..b46184fa1 100644 --- a/mindspore/dataset/transforms/vision/c_transforms.py +++ b/mindspore/dataset/transforms/vision/c_transforms.py @@ -452,11 +452,11 @@ class Pad(cde.PadOp): class UniformAugment(cde.UniformAugOp): """ - Tensor operation to perform randomly selected augmentation + Tensor operation to perform randomly selected augmentation. Args: operations: list of C++ operations (python OPs are not accepted). - NumOps (int): number of OPs to be selected and applied. + num_ops (int): number of OPs to be selected and applied. Examples: >>> transforms_list = [c_transforms.RandomHorizontalFlip(), diff --git a/mindspore/dataset/transforms/vision/validators.py b/mindspore/dataset/transforms/vision/validators.py index 63cb7683c..631d478d4 100644 --- a/mindspore/dataset/transforms/vision/validators.py +++ b/mindspore/dataset/transforms/vision/validators.py @@ -23,6 +23,7 @@ from .utils import Inter, Border from ...transforms.validators import check_pos_int32, check_pos_float32, check_value, check_uint8, FLOAT_MAX_INTEGER, \ check_bool, check_2tuple, check_range, check_list, check_type, check_positive, INT32_MAX + def check_inter_mode(mode): if not isinstance(mode, Inter): raise ValueError("Invalid interpolation mode.") @@ -838,7 +839,7 @@ def check_uniform_augmentation(method): if num_ops > len(operations): raise ValueError("num_ops is greater than operations list size") if not isinstance(operations, list): - raise ValueError("operations is not a python list") + raise TypeError("operations is not a python list") for op in operations: if not isinstance(op, TensorOp): raise ValueError("operations list only accepts C++ operations.") -- GitLab