Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.
This repository was archived by the owner on May 1, 2025. It is now read-only.

Overflow in autocontrast_func #134

@MagnusOstertag

Description

@MagnusOstertag

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions