We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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
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!
The text was updated successfully, but these errors were encountered:
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
Sorry, something went wrong.
duplicate of #72
No branches or pull requests
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!
The text was updated successfully, but these errors were encountered: