You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an issue with the Size method failing when a tuple is passed as argument; it was also open here: #200
The issue itself appears easy to solve, you just have to check whether the size in input is a tuple or not. Maybe something like this:
#call method of transforms.Scale
def __call__(self, img):
w, h = img.size
if (w <= h and w == self.size) or (h <= w and h == self.size):
return img
if w < h:
ow = self.size
oh = int(self.size * h / w) <-- issue here if self.size is a tuple
return img.resize((ow, oh), self.interpolation)
else:
if isinstance(self.size, tuple): #<--- check if tuple, in which case just use it
return img.resize(self.size, self.interpolation)
oh = self.size
ow = int(self.size * w / h)
return img.resize((ow, oh), self.interpolation)
The text was updated successfully, but these errors were encountered:
Hi @antspy this has been fixed in this PR. However, a new version of torchvision has not been released. If you install from source you will have this fix.
@fmassa I think we can close this issue and #200 - perhaps we should cut a release soon too as it's been quite a few months since the last one.
Hi,
There is an issue with the Size method failing when a tuple is passed as argument; it was also open here: #200
The issue itself appears easy to solve, you just have to check whether the size in input is a tuple or not. Maybe something like this:
The text was updated successfully, but these errors were encountered: