I was getting a RuntimeWarning: overflow encountered in scalar negative for offset = -low * scale in dataset/randaugment.py:32:.
The reason is that low is of class 'numpy.uint8', offset assumes this datatype, leading to problems in cases where scale is a floating point number, e.g. scale=1.0805084745762712, low=2. This leads to a wrong offset calculation because of the overflow, e.g. with offset: 274.4491525423729.
The bug could be easily fixed with casting the type of low as in offset = -np.float64(low) * scale.
I was getting a
RuntimeWarning: overflow encountered in scalar negative
foroffset = -low * scale
indataset/randaugment.py:32:
.The reason is that
low
is ofclass 'numpy.uint8'
,offset
assumes this datatype, leading to problems in cases wherescale
is a floating point number, e.g.scale=1.0805084745762712, low=2
. This leads to a wrong offset calculation because of the overflow, e.g. withoffset: 274.4491525423729
.The bug could be easily fixed with casting the type of
low
as inoffset = -np.float64(low) * scale
.