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

Fix EfficientAD to use width and height of the input #1355

Merged

Conversation

abc-125
Copy link
Contributor

@abc-125 abc-125 commented Sep 23, 2023

Description

AutoEncoder in EfficientAD uses both the width and height of the original image for upscaling, and the size of its output matches the output of other models.

File "./anomalib/src/anomalib/models/efficient_ad/torch_model.py", line 322, in forward
    distance_ae = torch.pow(teacher_output_aug - ae_output_aug, 2)
RuntimeError: The size of tensor a (56) must match the size of tensor b (120) at non-singleton dimension 3
Epoch 0:   0%|          | 0/215 [00:00<?, ?it/s]  

Changes

Describe the changes you made
  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which refactors the code base)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

Ensure that you followed the following
  • I have added a summary of my changes to the CHANGELOG (not for minor changes, docs and tests).
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas (If applicable)
  • I have made corresponding changes to the documentation (If applicable)
  • I have added tests that prove my fix is effective or that my feature works (If applicable)

Copy link
Contributor

@samet-akcay samet-akcay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix. I only have one formatting suggestion to avoid CI to fail

src/anomalib/models/efficient_ad/torch_model.py Outdated Show resolved Hide resolved
Co-authored-by: Samet Akcay <samet.akcay@intel.com>
@samet-akcay samet-akcay merged commit c97762c into openvinotoolkit:main Sep 26, 2023
5 of 6 checks passed
@abc-125 abc-125 deleted the fix/efficientad-not-squared-input branch December 26, 2023 16:38
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.

[Help][EfficientAD] How to change the input size of training processs?
2 participants