-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[MXNET-14421] Make global pooling backwards compatible #15026
Conversation
this is for backwards compatibility
8911c02
to
fb7867b
Compare
src/operator/nn/pooling-inl.h
Outdated
@@ -178,6 +178,12 @@ template<typename xpu, typename DType> | |||
class PoolingOp { | |||
public: | |||
void Init(PoolingParam p) { | |||
if (p.global_pool && (p.pad[0] || p.pad[1])) { |
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.
I don't think this is the best place for this. Can someone suggest a better place? @piiswrong
@mxnet-label-bot add [Operator, C++, pr-awaiting-review] |
The C++ label is meant for API defined in cpp-package. Removing the label as the issue is not related to those API. |
Im not sure this should be merged, but it could provide assistance to those who have trained with the previous behavior and need a work around. |
@jmerkow could you look into the CI failures? |
Thank you @jmerkow for all the effort in debugging the root cause and getting this PR. This PR and the issue is a great reference for people facing similar issue. As you rightly mentioned, I think we cannot merge this PR because that would be like backward compatibility of a bug. We should probably have this workaround suggested to users instead and encourage to upgrade to latest version of MXNet. |
I agree probably not worth merging it’s an edge case, but hopefully if someone comes across this issue they’ll find this and see the PR as a work around. We’ve started the process of retraining or deprecating networks effected by this bug (a long process...) so well eventually be able to upgrade. |
Thank you. Closing the PR and the issue. Sorry, it is unfortunate you people have to retrain a lot of models due to this bug. Keep us updated and cut us if you find any other issues. |
Description
There was a backward compatibility breaking change (#9730) to pooling where pad is explicitly overwritten causing global pooling to produce different results. This causes issues in any networks trained before this was changed as any layers after a global pooling layer will not get different input and therefore provide incorrect results.
To be clear, it is mathematically correct to have padding == 0. The PR will not effect anytime the layer is used without setting pad (the default is zero), it will only effect times when global_pool=True and pad is non-zero. It also adds a warning that adding padding with global_pool=True leads to incorrect results and should not be done. This PR is to provide backward compatibility only.
Issue: #14421
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments
This is to allow backward compatibility only. It should not affect anyone unless they have explicitly set global_pool=True and padding to non-zero. This is for any networks trained before the change was made to work, and should not adversely affect any users.