-
Notifications
You must be signed in to change notification settings - Fork 415
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
Put input transforms into train mode before converting models #1283
Conversation
This pull request was exported from Phabricator. Differential Revision: D37542474 |
Codecov Report
@@ Coverage Diff @@
## main #1283 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 122 122
Lines 10595 10601 +6
=========================================
+ Hits 10595 10601 +6
Continue to review full report at Codecov.
|
…h#1283) Summary: Pull Request resolved: pytorch#1283 Fixes pytorch#1273 During model construction, input transforms should be in `train` mode (so that they only apply if `transform_on_train` is true). Having the input transforms in eval mode leads to buggy behavior due to `transformed_X` getting transformed when it shouldn't. Differential Revision: D37542474 fbshipit-source-id: f4278294de5d83d967f3d21c312370e562cf372c
3a9b29c
to
bac446a
Compare
This pull request was exported from Phabricator. Differential Revision: D37542474 |
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.
lgtm, thanks!
…putModel` Summary: This fixes a bug where, due to the input transform being in `train` mode while the model is in `eval` mode, the learnable bounds of input transforms, such as Normalize, would be wrongly updated during model training, effectively disabling the transforms. This is a serious bug that was leading to using the model trained with normalized inputs on a model without any normalization. It has been around for a while, since pytorch#1283 :'(. Differential Revision: D40453200 fbshipit-source-id: d30e9ba18fa466c01bbf3273165e6e35ac33c219
…putModel` (pytorch#1454) Summary: Pull Request resolved: pytorch#1454 This fixes a bug where, due to the input transform being in `train` mode while the model is in `eval` mode, the learnable bounds of input transforms, such as Normalize, would be wrongly updated during model training, effectively disabling the transforms. This is a serious bug that was leading to using the model trained with normalized inputs on a model without any normalization. It has been around for a while, since pytorch#1283 :'(. Differential Revision: D40453200 fbshipit-source-id: 0d60ac5f23efe06e200713555dfa109b612d9290
…putModel` (#1454) Summary: Pull Request resolved: #1454 This fixes a bug where, due to the input transform being in `train` mode while the model is in `eval` mode, the learnable bounds of input transforms, such as Normalize, would be wrongly updated during model training, effectively disabling the transforms. This is a serious bug that was leading to using the model trained with normalized inputs on a model without any normalization. It has been around for a while, since #1283 :'(. Reviewed By: Balandat Differential Revision: D40453200 fbshipit-source-id: 3a431406de07565a6ccab3ab22ddc667a39b8c2c
Summary:
Fixes #1273
During model construction, input transforms should be in
train
mode (so that they only apply iftransform_on_train
is true).Having the input transforms in eval mode leads to buggy behavior due to
transformed_X
getting transformed when it shouldn't.Differential Revision: D37542474