Skip to content
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

Fixing image formatting for test data sets #2104

Closed

Conversation

kieranfraser
Copy link
Collaborator

Description

A number of utility functions are defined in conftest.py for loading default subsets of data (e.g. cifar10 and mnist) which are subsequently used in tests. Some of these methods, depending on the framework used (e.g. PyTorch), change the format of the images from HxWxC to CxHxW, and do so by calling np.reshape, which incorrectly changes the format of the images.

To fix, transpose should be used in place of reshape. This subsequently requires updating any tests which used the incorrect format for images.

Fixes #2101

Type of change

Please check all relevant options.

  • Improvement (non-breaking)
  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Testing

Please describe the tests that you ran to verify your changes. Consider listing any relevant details of your test configuration.

  • Test A
  • Test B

Test Configuration:

  • OS
  • Python version
  • ART version or commit number
  • TensorFlow / Keras / PyTorch / MXNet version

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2023

Codecov Report

Merging #2104 (997e05d) into dev_1.15.1 (3585836) will decrease coverage by 0.42%.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Impacted file tree graph

@@              Coverage Diff               @@
##           dev_1.15.1    #2104      +/-   ##
==============================================
- Coverage       85.61%   85.19%   -0.42%     
==============================================
  Files             308      308              
  Lines           27448    27448              
  Branches         5044     5044              
==============================================
- Hits            23499    23385     -114     
- Misses           2669     2775     +106     
- Partials         1280     1288       +8     

see 7 files with indirect coverage changes

@beat-buesser beat-buesser self-requested a review April 18, 2023 15:48
@beat-buesser beat-buesser self-assigned this Apr 18, 2023
Signed-off-by: Kieran Fraser <[email protected]>
@kieranfraser kieranfraser changed the base branch from main to dev_1.15.1 July 13, 2023 09:50
@beat-buesser beat-buesser deleted the branch Trusted-AI:dev_1.15.1 July 3, 2024 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect image format for default test subsets
3 participants