-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Replaced ToTensor with a combination of PILToTensor and ConvertImageDtype #4481
Replaced ToTensor with a combination of PILToTensor and ConvertImageDtype #4481
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes LGTM, but there are additional references of ToTensor in other places. I think it's worth removing them from code usages and documentation.
Here are some examples:
>>> transforms.ToTensor(), |
vision/torchvision/transforms/transforms.py
Line 1573 in c8e3b2a
>>> transforms.ToTensor(), |
T.ToTensor(), |
vision/references/segmentation/presets.py
Line 14 in c8e3b2a
T.ToTensor(), |
Feel free to merge this PR if you want and open another one to address the rest, or do the changes here. Whatever works for you.
Thanks @datumbox! I already replaced T.ToTensor() in detection and segmentation to be a combination of pil_to_tensor() and convert_image_dtype() in #4452. I'll update the example usages under torchvision in a separate PR. |
@prabhat00155 You are right, I missed the fact that we use a custom How would you feel about replacing the custom |
Yeah, sure. I can make that change. |
…ertImageDtype (#4481) Summary: * Replaced ToTensor with a combination of PILToTensor and ConvertImageDtype * Pass dtype Reviewed By: datumbox Differential Revision: D31268058 fbshipit-source-id: 17f7c3994ce202f6457e589fd986038da3532dee
…type (#4481) * Replaced ToTensor with a combination of PILToTensor and ConvertImageDtype * Pass dtype [ghstack-poisoned]
…type (#4481) * Replaced ToTensor with a combination of PILToTensor and ConvertImageDtype * Pass dtype [ghstack-poisoned]
…type (pytorch#4481) * Replaced ToTensor with a combination of PILToTensor and ConvertImageDtype * Pass dtype
Training logs before these changes:
training_log_no_changes.txt
Training logs after these changes:
training_log_after_changes.txt
cc @datumbox