Reputation: 3
I am working on tensors and want to rotate them with torchvision.transforms.RandomRotation
and use the fill
option.
import torch
import torchvision
img1 = torch.rand((1, 16, 16))
img2 = torchvision.transforms.RandomRotation(45, fill=1)(img1)
However, I always get:
Argument fill/fillcolor is not supported for Tensor input. Fill value is zero
and it gets not filled with ones. I have the same problem with torchvision.transforms.RandomPerspective
.
I am using Python 3.8 and PyTorch 1.7.1. I tried using fill=(1,)
, which seemed to be a workaround, but it did not worked for me. Do you know what could be wrong?
Upvotes: 0
Views: 1967
Reputation: 1839
Newer torch versions have the attribute name as 'fill' while prior to 2.0.0 it was 'fillcolor'
Upvotes: 0