Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

augment_image a batch of one #26

Open
colorfuldarkgray opened this issue Sep 19, 2023 · 0 comments
Open

augment_image a batch of one #26

colorfuldarkgray opened this issue Sep 19, 2023 · 0 comments

Comments

@colorfuldarkgray
Copy link

Hello!

I am trying to augment a batch of one

If I provide a tensor with shape (1,3,320,320):
augmented_image = transformer.augment_image(img_t.unsqueeze_(0))
I get:

ttach\functional.py:47, in scale(x, scale_factor, interpolation, align_corners)
45 def scale(x, scale_factor, interpolation="nearest", align_corners=None):
46 """scale batch of images by scale_factor with given interpolation mode"""
---> 47 h, w = x.shape[2:]
48 new_h = int(h * scale_factor)
49 new_w = int(w * scale_factor)
ValueError: too many values to unpack (expected 2)

If I provide a tensor with shape (3,320,320):
augmented_image = transformer.augment_image(img_t)
I get:

ttach\functional.py:7, in rot90(x, k)
5 def rot90(x, k=1):
6 """rotate batch of images by 90 degrees k times"""
----> 7 return torch.rot90(x, k, (2, 3))
RuntimeError: Rotation dim1 out of range, dim1 = 3

What to do?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant