Open lijoe123 opened 11 months ago
If you're doing binary segmentation the FAQ might help. I say this as your num_classes=1
, and you are using softmax (use_sigmoid=False
) which can be odd for binary segmentation. Something similar has caused errors like this for me in the past.
If you're using a custom dataset, while converting your dataset keep in mind this line from the docs:
:::{note} The annotations are images of shape (H, W), the value pixel should fall in range [0, num_classes - 1].
You may use 'P' mode of [pillow](https://pillow.readthedocs.io/en/stable/handbook/concepts.html#palette) to create your annotation image with color. :::
The demo tutorial has a good example of converting a dataset to the right format.
Also keep in mind the parameter reduce_zero_label
, which is in the FAQ as well (first link).
For binary segmentation reduce_zero_label
should be False
, as in the chase_db1.py:
def __init__(self,
img_suffix='.png',
seg_map_suffix='_1stHO.png',
reduce_zero_label=False, # <---- Hard coded as false
**kwargs) -> None:
super().__init__(
img_suffix=img_suffix,
seg_map_suffix=seg_map_suffix,
reduce_zero_label=reduce_zero_label, # <---- False passed to `super`
**kwargs)
assert fileio.exists(
self.data_prefix['img_path'], backend_args=self.backend_args)
Thank you for yout answer. I found that my annotation of my dataset got some problem. I had figure it out.
"RuntimeError: CUDA error: an illegal memory access was encountered" This error happened to me during training (mmsegmentation\tools\train.py) when my label images contained class numbers outside the 150 class range expected. Example) ` class ADE20KDataset(BaseSegDataset):
METAINFO = dict(
classes=('wall', 'building', 'sky', 'floor', 'tree', 'ceiling', 'road', ...)
`
Hello, I had met a guestion when i train the meidical dataset with two class. And i used the model is unet-pspnet based on chase_db1.py. The problem as shown in:
Could you give me some advice? Thank you so much!