I try to rotate an image using torchvision.transforms.functional.rotate and I get this error:
  File "C:\Users\User\Documents\programming\proj\utils.py", line 55, in __call__
    image = torchvision.transforms.functional.rotate(PIL_image, angle)
  File "C:\Users\User\Anaconda3\envs\surv\lib\site-packages\torchvision\transforms\functional.py", line 729, in rotate
    return img.rotate(angle, resample, expand, center, fillcolor=fill)
  File "C:\Users\User\Anaconda3\envs\surv\lib\site-packages\PIL\Image.py", line 1915, in rotate
    fillcolor=fillcolor)
  File "C:\Users\User\Anaconda3\envs\surv\lib\site-packages\PIL\Image.py", line 2205, in transform
    im = new(self.mode, size, fillcolor)
  File "C:\Users\User\Anaconda3\envs\surv\lib\site-packages\PIL\Image.py", line 2375, in new
    return Image()._new(core.fill(mode, size, color))
TypeError: must be real number, not tuple

If I do PIL_image.rotate(angle) it works (using PIL’s rotation utility), but for some reason using pytorch’s torchvision.transforms.functional.rotate gives an error. How should I resolve this?