I get the following error message after updating to the latest torchvision.
The transformation that causes the error is randomRotation.
I believe that it’s related to the following bugfix:
Moreover, it only happens when it is preceded by
transforms.Grayscale(num_output_channels=1) .
How can i make it work without downgrading?
Thank you.
File "/Users/user/opt/anaconda3/envs/vident/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
data = fetcher.fetch(index)
File "/Users/user/opt/anaconda3/envs/vident/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/Users/user/opt/anaconda3/envs/vident/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/Users/user/opt/anaconda3/envs/vident/lib/python3.7/site-packages/torch/utils/data/dataset.py", line 257, in __getitem__
return self.dataset[self.indices[idx]]
File "/Users/user/opt/anaconda3/envs/vident/lib/python3.7/site-packages/torchvision/datasets/folder.py", line 140, in __getitem__
sample = self.transform(sample)
File "/Users/user/opt/anaconda3/envs/vident/lib/python3.7/site-packages/torchvision/transforms/transforms.py", line 70, in __call__
img = t(img)
File "/Users/user/opt/anaconda3/envs/vident/lib/python3.7/site-packages/torchvision/transforms/transforms.py", line 1003, in __call__
return F.rotate(img, angle, self.resample, self.expand, self.center, self.fill)
File "/Users/user/opt/anaconda3/envs/vident/lib/python3.7/site-packages/torchvision/transforms/functional.py", line 729, in rotate
return img.rotate(angle, resample, expand, center, fillcolor=fill)
File "/Users/user/opt/anaconda3/envs/vident/lib/python3.7/site-packages/PIL/Image.py", line 1915, in rotate
fillcolor=fillcolor)
File "/Users/user/opt/anaconda3/envs/vident/lib/python3.7/site-packages/PIL/Image.py", line 2205, in transform
im = new(self.mode, size, fillcolor)
File "/Users/user/opt/anaconda3/envs/vident/lib/python3.7/site-packages/PIL/Image.py", line 2375, in new
return Image()._new(core.fill(mode, size, color))
TypeError: function takes exactly 1 argument (3 given)