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

PaDim occasionally NaNs in anomaly map #392

Merged
merged 2 commits into from
Jul 1, 2022
Merged

PaDim occasionally NaNs in anomaly map #392

merged 2 commits into from
Jul 1, 2022

Conversation

VdLMV
Copy link
Contributor

@VdLMV VdLMV commented Jun 29, 2022

With custom dataset and backbone distances sometimes contains small negative numbers, possible due to imperfect pseudo inverse calculation. Solution was to clip distances to zero before sqrt.

  • Solution is to clip distances to zero before sqrt.

  • Fixes # (issue)

Changes

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

Checklist

  • My code follows the [pre-commit style and check guidelines](https://openvinotoolkit.github .io/anomalib/guides/using_pre_commit.html#pre-commit-hooks) of this project.
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • 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 tests pass locally with my changes

…es contains small negative numbers, possible due to imperfect pseudo inverse calculation.
@VdLMV
Copy link
Contributor Author

VdLMV commented Jun 29, 2022

@samet-akcay : I don't understand pre-merge fail. Plz your help.

@samet-akcay
Copy link
Contributor

@VdLMV, looks like some of the tests in tests/pre_merge/deploy/test_inferencer.py fails with this change. I'll check it out and let you know.

@samet-akcay
Copy link
Contributor

@VdLMV, your change is fine, I'll approve it. However, PADIM started to fail in the tests for some reason. It fails when the model is exported to ONNX. We'll investigate this a bit deeper.

@samet-akcay
Copy link
Contributor

@VdLMV, the reason turned out to be the latest torchvision version, which causes some issues on the ONNX / OpenVINO side. I'll merge this one now.

@samet-akcay samet-akcay merged commit 92e243f into openvinotoolkit:development Jul 1, 2022
@samet-akcay samet-akcay linked an issue Jul 11, 2022 that may be closed by this pull request
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.

PaDiM: model outputs NaN when inferencing images sequencially
2 participants