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

Constant IoU after every validation #2050

Closed
cspearl opened this issue Sep 8, 2022 · 11 comments
Closed

Constant IoU after every validation #2050

cspearl opened this issue Sep 8, 2022 · 11 comments
Assignees

Comments

@cspearl
Copy link

cspearl commented Sep 8, 2022

Hi, I was a bit late to reply to my issue(assigned to @MengzhangLI ) that I was having so it probably got skipped. Please find the details of the issue and the log file here : #1988
Appreciate any help!

@sainivedh19pt
Copy link

Hi @cspearl @MengzhangLI,
Faced the same issue when trained using latest codebase commit for binary class segmentation (roads class).
mIOU, aACC, mACC is the same through out training.
Attaching log file below.
20220907_152411.log

Thanks

@MengzhangLI
Copy link
Contributor

Hi, @sainivedh19pt, try to set your dataset annotation 0 and 1 and set reduce_zero_label=False in your config file.

You can check out what does reduce_zero_label work from here.

@MengzhangLI
Copy link
Contributor

Hi, @cspearl, could you try to set reduce_zero_label = False, and num_classes = 1 and ensure your annotation files only have label 0 and label 1?

@cspearl
Copy link
Author

cspearl commented Sep 15, 2022

Hi, @cspearl, could you try to set reduce_zero_label = False, and num_classes = 1 and ensure your annotation files only have label 0 and label 1?

Yes I tried but it gives the same result. My annotation files only have 0 - background and 1 - foreground labels.

@xiexinch
Copy link
Collaborator

Hi @cspearl,
Could you try to set the different thresholds to the decode_head?

@cspearl
Copy link
Author

cspearl commented Sep 16, 2022

Hi @cspearl, Could you try to set the different thresholds to the decode_head?

Can you elaborate a bit on what to add? In the decode head dict

@MengzhangLI
Copy link
Contributor

Hi @cspearl, Could you try to set the different thresholds to the decode_head?

Can you elaborate a bit on what to add? In the decode head dict

https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/models/decode_heads/decode_head.py#L23-L24

@AndrewTrefilov
Copy link

AndrewTrefilov commented Sep 21, 2022

Hi, @MengzhangLI
same problem..
in decode_head and auxiliary_head num_classes=2

2022-09-22 00:22:24,627 - mmseg - INFO - 
+------------+-------+-------+--------+-----------+--------+
|   Class    |  IoU  |  Acc  | Fscore | Precision | Recall |
+------------+-------+-------+--------+-----------+--------+
| background | 44.56 | 45.68 | 61.65  |   94.78   | 45.68  |
|   class   |  0.01 |  0.31 |  0.03  |    0.01   |  0.31  |
+------------+-------+-------+--------+-----------+--------+

custom dataset:


from mmseg.datasets.builder import DATASETS
from mmseg.datasets.custom import CustomDataset

CLASSES = ['background', 'class']
PALETTE = [[0, 0, 0], [244, 35, 232]]

@DATASETS.register_module()
class MylDataset(CustomDataset):
  CLASSES = CLASSES
  PALETTE = PALETTE
  def __init__(self, **kwargs):
    super().__init__(
        img_suffix='.png', seg_map_suffix='.png',
        **kwargs
        )
    assert osp.exists(self.img_dir) #and self.split is not None```

@MengzhangLI
Copy link
Contributor

Hi, sorry for late reply. Did you solve your problem?

You can have a look at #2201 by setting num_classes=1 and use_sigmoid=True in CrossEntropyLoss.

@MengzhangLI
Copy link
Contributor

Hi @cspearl @MengzhangLI, Faced the same issue when trained using latest codebase commit for binary class segmentation (roads class). mIOU, aACC, mACC is the same through out training. Attaching log file below. 20220907_152411.log

Thanks

From your log could you keep every parameter in config except setting reduce_zero_label=False? Thx.

@xiexinch
Copy link
Collaborator

Closing the issue, as there is no activity for a while.
We hope your issue has been resolved.
If not, please feel free to open a new one.

aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this issue Mar 27, 2023
* Switch to huggingface_hub.ModelCard

* Remove modelcards dependency in favor of Jinja2
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

No branches or pull requests

5 participants