diff --git a/python/paddle/vision/transforms/transforms.py b/python/paddle/vision/transforms/transforms.py index 27eca19c28be6ccfada7aeaa56a5615d1b6aa2f7..c09748913f9dadb8286e5b9664fa35b1b9a3ffc6 100644 --- a/python/paddle/vision/transforms/transforms.py +++ b/python/paddle/vision/transforms/transforms.py @@ -555,6 +555,7 @@ class RandomHorizontalFlip(BaseTransform): def __init__(self, prob=0.5, keys=None): super(RandomHorizontalFlip, self).__init__(keys) + assert 0 <= prob <= 1, "probability must be between 0 and 1" self.prob = prob def _apply_image(self, img): @@ -589,6 +590,7 @@ class RandomVerticalFlip(BaseTransform): def __init__(self, prob=0.5, keys=None): super(RandomVerticalFlip, self).__init__(keys) + assert 0 <= prob <= 1, "probability must be between 0 and 1" self.prob = prob def _apply_image(self, img):