-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Add epsilon for tolerance level to fix flaky test random_resize_crop #15098
Conversation
@mxnet-label-bot add [Python, Test, Flaky] |
aba2bea
to
f1fc081
Compare
f1fc081
to
64836af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the fix!
def test_random_size_crop(self): | ||
# test aspect ratio within bounds | ||
width = np.random.randint(100, 500) | ||
height = np.random.randint(100, 500) | ||
src = np.random.rand(height, width, 3) * 255. | ||
ratio = (0.75, 1) | ||
epsilon = 0.05 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do we decide epsilon? is 0.05 too large here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @stu1130 for the discussion offline. The randomness is caused by sqrt of area / or * ratio. Same epsilon is used in pytorch test as well. Approve this change thereby.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
check all the seeds listed below
Those ration of width and height are around 0.748 and cross compared with Pytorch unit test found out that we need epsilon.
ran 10k times
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments
@zhreshold @abhinavs95