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] Fix the bug that when all pixels in an image is ignored, the ac… #1336

Merged
merged 5 commits into from
Mar 9, 2022

Conversation

RockeyCoss
Copy link
Contributor

…curacy calculation raises ZeroDivisionError

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

Fix the bug that when all pixels in an image is ignored, the accuracy computation raises ZeroDivisionError

Modification

Fix the bug that when all pixels in an image is ignored, the accuracy computation raises ZeroDivisionError

…curacy calculation raises ZeroDivisionError
@codecov
Copy link

codecov bot commented Mar 1, 2022

Codecov Report

Merging #1336 (72aa6d3) into master (9947a39) will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1336      +/-   ##
==========================================
+ Coverage   90.26%   90.32%   +0.06%     
==========================================
  Files         131      132       +1     
  Lines        7611     7702      +91     
  Branches     1264     1290      +26     
==========================================
+ Hits         6870     6957      +87     
  Misses        531      531              
- Partials      210      214       +4     
Flag Coverage Δ
unittests 90.32% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmseg/models/losses/accuracy.py 100.00% <100.00%> (ø)
mmseg/core/utils/__init__.py 100.00% <0.00%> (ø)
...eg/core/utils/layer_decay_optimizer_constructor.py 94.80% <0.00%> (ø)
mmseg/datasets/pipelines/transforms.py 98.06% <0.00%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9947a39...72aa6d3. Read the comment docs.

@RockeyCoss RockeyCoss self-assigned this Mar 8, 2022
Copy link
Collaborator

@MeowZheng MeowZheng left a comment

Choose a reason for hiding this comment

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

please fix ut error

@@ -46,10 +46,13 @@ def accuracy(pred, target, topk=1, thresh=None, ignore_index=None):
correct = correct & (pred_value > thresh).t()
correct = correct[:, target != ignore_index]
res = []
eps = 1e-6
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

@Junjun2016 Junjun2016 left a comment

Choose a reason for hiding this comment

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

LGTM, except for the definition of eps.

@MeowZheng MeowZheng merged commit 66b3790 into open-mmlab:master Mar 9, 2022
@MengzhangLI MengzhangLI mentioned this pull request Mar 9, 2022
mob5566 pushed a commit to mob5566/mmsegmentation that referenced this pull request Apr 13, 2022
open-mmlab#1336)

* [Fix] Fix the bug that when all pixels in an image is ignored, the accuracy calculation raises ZeroDivisionError

* use eps

* all close

* add ignore test

* add eps
ZhimingNJ pushed a commit to AetrexTechnology/mmsegmentation that referenced this pull request Jun 29, 2022
open-mmlab#1336)

* [Fix] Fix the bug that when all pixels in an image is ignored, the accuracy calculation raises ZeroDivisionError

* use eps

* all close

* add ignore test

* add eps
aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this pull request Mar 27, 2023
* Add heun

* Finish first version of heun

* remove bogus

* finish

* finish

* improve

* up

* up

* fix more

* change progress bar

* Update src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py

* finish

* up

* up

* up
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.

4 participants