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
InterpolationMode.NEAREST_EXACT
interpolation
RandomRotation()
Setting InterpolationMode.BOX to interpolation argument of RandomRotation() gets the error message as shown below:
InterpolationMode.BOX
from torchvision.datasets import OxfordIIITPet from torchvision.transforms.v2 import RandomRotation from torchvision.transforms.functional import InterpolationMode rr = RandomRotation(degrees=[90.0, 90.0], interpolation=InterpolationMode.BOX) # ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ import matplotlib.pyplot as plt plt.imshow(X=rr(my_data[0][0])) # Error plt.show()
ValueError: Image.Resampling.BOX (4) cannot be used. Use Image.Resampling.NEAREST (0), Image.Resampling.BILINEAR (2) or Image.Resampling.BICUBIC (3)
But setting InterpolationMode.NEAREST_EXACT to interpolation argument of RandomRotation() works against the error message as shown below:
from torchvision.datasets import OxfordIIITPet from torchvision.transforms.v2 import RandomRotation from torchvision.transforms.functional import InterpolationMode rr = RandomRotation(degrees=[90.0, 90.0], interpolation=InterpolationMode.NEAREST_EXACT) # ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ import matplotlib.pyplot as plt plt.imshow(X=rr(my_data[0][0])) plt.show()
So, the error message should also have Image.Resampling.NEAREST_EXACT (1) as shown below:
Image.Resampling.NEAREST_EXACT (1)
ValueError: Image.Resampling.BOX (4) cannot be used. Use Image.Resampling.NEAREST (0), Image.Resampling.NEAREST_EXACT (1), Image.Resampling.BILINEAR (2) or Image.Resampling.BICUBIC (3)
import torchvision torchvision.__version__ # '0.20.1+cpu'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
🐛 Describe the bug
Setting
InterpolationMode.BOX
tointerpolation
argument of RandomRotation() gets the error message as shown below:But setting
InterpolationMode.NEAREST_EXACT
tointerpolation
argument ofRandomRotation()
works against the error message as shown below:So, the error message should also have
Image.Resampling.NEAREST_EXACT (1)
as shown below:Versions
The text was updated successfully, but these errors were encountered: