Skip to content

num_ops argument of RandAugment() shouldn't accept negative values #8938

Open
@hyperkai

Description

@hyperkai

🐛 Describe the bug

Setting negative values to num_ops argument of RandAugment() doesn't do augmentation transformations at all as shown below:

from torchvision.datasets import OxfordIIITPet
from torchvision.transforms.v2 import RandAugment

my_data = OxfordIIITPet(
    root="data",
    transform=RandAugment(num_ops=-1)
    # transform=RandAugment(num_ops=-10)
    # transform=RandAugment(num_ops=-100)
)

my_data[0][0]

Image

And, num_ops argument is the number of augmentation transformations according to the doc as shown below:

Parameters:

  • num_ops (int, optional) – Number of augmentation transformations to apply sequentially

So num_ops argument of RandAugment() shouldn't accept negative values.

Versions

import torchvision

torchvision.__version__ # '0.20.1'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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