From fc963892caa154073ea9cc97a80df9b061f17483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dejan=20=C5=A0tepec?= <25041003+ds2268@users.noreply.github.com> Date: Sat, 26 Nov 2022 11:58:21 +0100 Subject: [PATCH] Support for latest torchvision - get_image_size Private function _get_image_size was changed to public in torchvision v0.11. The use of torchvision v0.11 and above will result in the following error: https://github.com/pytorch/vision/issues/4328 --- transforms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transforms.py b/transforms.py index 7ccbab8..dbab259 100644 --- a/transforms.py +++ b/transforms.py @@ -120,7 +120,7 @@ def get_params(img, scale, ratio): tuple: params (i, j, h, w) to be passed to ``crop`` for a random sized crop. """ - width, height = FT._get_image_size(img) + width, height = FT.get_image_size(img) area = height * width log_ratio = torch.log(torch.tensor(ratio))