Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting the 2D list of str type to RandomRotation(), RandomHorizontalFlip() and RandomVerticalFlip() after instantiation works #8862

Open
hyperkai opened this issue Jan 16, 2025 · 1 comment

Comments

@hyperkai
Copy link

hyperkai commented Jan 16, 2025

🐛 Describe the bug

Setting the 2D list of str type to RandomRotation(), RandomHorizontalFlip() and RandomVerticalFlip() after instantiation works as shown below:

from torchvision.transforms.v2 import RandomRotation
from torchvision.transforms.v2 import RandomHorizontalFlip
from torchvision.transforms.v2 import RandomVerticalFlip

rr = RandomRotation(degrees=0)
rr([['Hello']])
# [['Hello']]

rhf = RandomHorizontalFlip(p=0)
rhf([['Hello']])
#[['Hello']]

rvf = RandomVerticalFlip(p=0)
rvf ([['Hello']])
# [['Hello']]

I think it's problematic to accept the 2D list of str type because the function is for an image.

@hyperkai hyperkai changed the title Setting the 3D tensor of str type to RandomAffine() after instantiation got an indirect error message Setting the 2D list of str type to RandomRotation(), RandomHorizontalFlip() and RandomVerticalFlip() after instantiation works Jan 16, 2025
@hyperkai
Copy link
Author

import torchvision

torchvision.__version__ # '0.20.1'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant