-
Notifications
You must be signed in to change notification settings - Fork 19.6k
Fix: UpSampling2D bilinear channels_first bug #21439
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
Fix: UpSampling2D bilinear channels_first bug #21439
Conversation
The current approach transforms the tensor to channels_last, before passing it in ops.image.resize, which has been defined as channels_first. This creates a bug, a passed in tensor [16, 3, 224, 224] will return as shape [16, 448, 224, 448] instead of [16, 3, 448, 448]. Setting the data_format as the expected channels_last fixes that issue. Closes keras-team#21401
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #21439 +/- ##
=======================================
Coverage 82.72% 82.72%
=======================================
Files 565 565
Lines 55247 55247
Branches 8613 8613
=======================================
Hits 45702 45702
Misses 7433 7433
Partials 2112 2112
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hi @tristandb8 Can you please sign CLA? Thank you! |
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 for the PR!
- Please add a unit test for this change.
- Please run the code formatter.
There was an issue with CLA, the author email it was asking me to verify doesn't exist. I made a new PR (#21456) instead, which passes the CLA and includes the required unit tests. |
The current approach transforms the tensor to channels_last, before passing it in ops.image.resize, which has been defined as channels_first. This creates a bug, a passed in tensor [16, 3, 224, 224] will return as shape [16, 448, 224, 448] instead of [16, 3, 448, 448]. Setting the data_format as the expected channels_last fixes that issue.
Closes #21401