-
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
add reference test for normalize_image_tensor #7119
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.
Thanks @pmeier , LGTM.
The ElasticTransform
seems unrelated (I've seen it fail locally as well, it might be a bit flaky?)
Yeah, we should add some tolerances. What worries me a little is the really high difference albeit only for a single pixel:
I'll look into it. |
I don't know if you're still working on these
the name is obviously terrible but I hope it illustrates the intent: often tests fail with just one or a few pixels don't satisfy the condition, and that's OK. |
You are right, but these are very vision centric. Although not publicly documented, we made it really easy to extend vision/test/prototype_common_utils.py Line 51 in d2d448c
that we add to |
I wouldn't say they're vision centric; in my scikit-learn days I would have killed for such a feature in the numpy's testing utils. I feel like it's relevant in any scenario when you want to compare an output tensor/array with a reference one. Re MAE: mean is sensitive to outliers so even if the tensor has a lot of values it can still be quite different - and it's not as easy to hard-code an expected MAE threshold. |
Ok, let me clarify:
If you are talking about general tensors / arrays I agree that this is not related to vision. I personally only ever encountered this issue with images so I never thought about this being a more general problem. Maybe send an issue to PyTorch core? I'll discuss this with the others if something like that is something we want to support on a public API. I'm currently leaning towards no, since we already have a sh*t ton of parameters and adding more that also tie in the actual comparison won't make it any easier. If you just want this for |
Reviewed By: YosuaMichael Differential Revision: D42706905 fbshipit-source-id: 0a3c5357d5e59454f265ec36fe52eae32da0b59f
Addresses #7113 (comment).
cc @vfdev-5 @bjuncek