We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
RandomRotation()
RandomAffine()
Setting the 1D list of 2 elements to RandomRotation() and RandomAffine() got the error message as shown below:
from torchvision.datasets import OxfordIIITPet from torchvision.transforms.v2 import RandomRotation from torchvision.transforms.v2 import RandomAffine my_data = OxfordIIITPet( root="data", transform=RandomRotation(degrees=[0.0, 0.0], fill=[50.0, 50.0]) ) my_data[0] # Error my_data = OxfordIIITPet( root="data", transform=RandomAffine(degrees=[0.0, 0.0], fill=[50.0, 50.0]) ) my_data[0] # Error
ValueError: The number of elements in 'fill' does not match the number of channels of the image (2 != 3)
But setting the 1D list of 1 element to RandomRotation() and RandomAffine() works against the above error message as shown below:
from torchvision.datasets import OxfordIIITPet from torchvision.transforms.v2 import RandomRotation from torchvision.transforms.v2 import RandomAffine my_data = OxfordIIITPet( root="data", transform=RandomRotation(degrees=[0.0, 0.0], fill=[50.0]) ) my_data[0] # (<PIL.Image.Image image mode=RGB size=394x500>, 0) my_data = OxfordIIITPet( root="data", transform=RandomAffine(degrees=[0.0, 0.0], fill=[50.0]) ) my_data[0] # (<PIL.Image.Image image mode=RGB size=394x500>, 0)
import torchvision torchvision.__version__ # '0.20.1'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
🐛 Describe the bug
Setting the 1D list of 2 elements to RandomRotation() and RandomAffine() got the error message as shown below:
But setting the 1D list of 1 element to
RandomRotation()
andRandomAffine()
works against the above error message as shown below:Versions
The text was updated successfully, but these errors were encountered: