diff --git a/torchvision/transforms/functional.py b/torchvision/transforms/functional.py index 2d1ab401a39..be2a94abab7 100644 --- a/torchvision/transforms/functional.py +++ b/torchvision/transforms/functional.py @@ -766,7 +766,7 @@ def affine(img, angle, translate, scale, shear, resample=0, fillcolor=None): output_size = img.size center = (img.size[0] * 0.5 + 0.5, img.size[1] * 0.5 + 0.5) matrix = _get_inverse_affine_matrix(center, angle, translate, scale, shear) - kwargs = {"fillcolor": fillcolor} if PILLOW_VERSION[0] == '5' else {} + kwargs = {"fillcolor": fillcolor} if PILLOW_VERSION[0] >= '5' else {} return img.transform(output_size, Image.AFFINE, matrix, resample, **kwargs)