-
Notifications
You must be signed in to change notification settings - Fork 239
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
Question about data augmentation in your ResNet image classifier example #8
Comments
The reason for this is that if the argument to If you really don't want to augment, then the fix is to change the resize to Why do you not want to crop your images? |
Many thanks Ben for your reply - it is clear now. I'm trying to avoid the cropping step in the augmentation since I need the model to see the full image. Some differences between images are often present on the edges of the images, and by center-cropping them, the model might not understand what constitutes each class. So I'd like to ensure it learns from the entire image and not a cropped zone. Hope that makes sense. |
Hello Ben - how can we remove the data augmentation step in your ResNet example? I need to pass the entire image in the training (no cropping).
I tried to modify the variables train_transforms and test_transforms to remove the rotation, horizontal flip and cropping, thus keeping only .Resize(), .ToTensor() and Normalize() in these variables. So the only thing I've modified in your script is:
But then when triggering the training loop, I get this error message:
invalid argument 0: Sizes of tensors must match except in dimension 0. Got 630 and 513 in dimension 3 at /opt/conda/conda-bld/pytorch_1579022060824/work/aten/src/TH/generic/THTensor.cpp:612
Any idea how to fix that?
Many thanks
The text was updated successfully, but these errors were encountered: