Skip to content

Setting the value of x <= 0 to chain_depth argument of AugMix() doesn't get error against the docΒ #8954

Open
@hyperkai

Description

@hyperkai

πŸ› Describe the bug

The doc of AugMix() says that chain_depth parameter is int as shown below:

Parameters:

  • ...
  • chain_depth (int) – The depth of augmentation chains. A negative value denotes stochastic

So, setting the value of 1 <= x to chain_depth argument gets the error properly as shown below:

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

my_data = OxfordIIITPet(
    root="data",
    transform=AugMix(chain_depth=1.0)
    # transform=AugMix(chain_depth=2.0)
    # transform=AugMix(chain_depth=3.0)
)

my_data[0] # Error

TypeError: 'float' object cannot be interpreted as an integer

But setting the value of x <= 0 to chain_depth argument doesn't get error against the doc as shown below:

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

my_data = OxfordIIITPet(
    root="data",
    transform=AugMix(chain_depth=0.0)
    # transform=AugMix(chain_depth=-1.0)
    # transform=AugMix(chain_depth=-2.0)
    # transform=AugMix(chain_depth=-3.0)
)

my_data[0]
# (<PIL.Image.Image image mode=RGB size=394x500>, 0)

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