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

is tencrop avaliable? #92

Closed
wooeagle opened this issue Feb 21, 2023 · 2 comments
Closed

is tencrop avaliable? #92

wooeagle opened this issue Feb 21, 2023 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@wooeagle
Copy link

hi! thanks for your repo, which is very useful.
i wondering about torchvision.transforms.TenCrop apply to your code.

i was attempt to change some code in extract_resnet.py

class ExtraResNet in extra_resnet.py

self.transforms = transforms.Compose([
transforms.ToPILImage(),
transforms.Resize(256),
transforms.CenterCrop(224), -> transforms.TenCrop(224),
transforms.ToTensor(), -> transforms.Lambda(lambda crops: torch.stack([transforms.ToTensor()(crop) for crop in crops])),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) ->
transforms.Lambda(lambda normal: torch.stack([transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])(normalize) for normalize in normal]))
])

but i got error as below:
RuntimeError: Expected 3d (unbatched) or 4d (batched) input to conv2d, but got input of size: [64, 10, 3, 224, 224]

please let me know if you have idea. thanks!

@v-iashin
Copy link
Owner

Hey, have got a similar request already #72

At the moment i don’t have time to implement it but i would appreciate if someone could take a look

@v-iashin v-iashin added the enhancement New feature or request label Jan 20, 2024
@v-iashin
Copy link
Owner

v-iashin commented May 2, 2024

duplicate of #72

@v-iashin v-iashin closed this as completed May 2, 2024
@v-iashin v-iashin added the help wanted Extra attention is needed label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants