open-mmlab / mmsegmentation

OpenMMLab Semantic Segmentation Toolbox and Benchmark.
https://mmsegmentation.readthedocs.io/en/main/
Apache License 2.0
8.34k stars 2.63k forks source link

为什么只识别出一种种类,其他的全为nan,这是什么出了问题? #744

Closed mhyu19 closed 3 years ago

mhyu19 commented 3 years ago

图片 图片

xiexinch commented 3 years ago

Hi @mhyu19

  1. What command, model and config did you run?
  2. Did you make any modifications on the code or config?
mhyu19 commented 3 years ago

config : pspnet_r18-d8_512x1024_80k_cityscapes.py 配置文件和代码都没有修改,我不确定是不是数据集的问题,因为我把cityscapes类别修改为一类---sidewalk,训练测试结果还是和19类一样。我正在重新获取cityspaces数据集,重新测试,如果结果正常我会在这个issue里贴出。 使用ADE20K数据集训练测试(pspnet_r50-d8_512x512_80k_ade20k.py)结果正常: [>>>>>>>>>>>>>>>>>>>>>>>>>>] 2000/2000, 12.7 task/s, elapsed: 158s, ETA: 0s2021-08-02 13:58:13,028 - mmseg - INFO - per class results: 2021-08-02 13:58:13,036 - mmseg - INFO - +---------------------+-------+-------+ | Class | IoU | Acc | +---------------------+-------+-------+ | wall | 49.22 | 61.61 | | building | 64.43 | 90.54 | | sky | 87.38 | 94.39 | | floor | 51.19 | 61.5 | | tree | 56.43 | 80.06 | | ceiling | 58.06 | 65.35 | | road | 64.22 | 79.16 | | bed | 35.77 | 94.03 | | windowpane | 37.14 | 60.43 | | grass | 52.32 | 76.29 | | cabinet | 30.86 | 61.86 | | sidewalk | 37.37 | 58.71 | | person | 46.82 | 74.28 | | earth | 21.2 | 27.82 | | door | 15.09 | 40.96 | | table | 20.11 | 30.09 | | mountain | 34.33 | 50.69 | | plant | 23.89 | 45.93 | | curtain | 32.46 | 54.79 | | chair | 26.6 | 65.96 | | car | 64.52 | 84.49 | | water | 17.8 | 20.36 | | painting | 32.68 | 70.14 | | sofa | 18.08 | 23.03 | | shelf | 14.85 | 23.95 | | house | 17.87 | 26.56 | | sea | 30.0 | 67.52 | | mirror | 9.16 | 11.81 | | rug | 13.53 | 14.67 | | field | 13.41 | 25.52 | | armchair | 1.17 | 1.21 | | seat | 10.87 | 11.76 | | fence | 4.95 | 5.47 | | desk | 8.48 | 16.15 | | rock | 1.83 | 1.86 | | wardrobe | 14.29 | 16.43 | | lamp | 32.01 | 43.58 | | bathtub | 24.49 | 37.1 | | railing | 5.49 | 5.65 | | cushion | 20.96 | 41.18 | | base | 0.62 | 0.66 | | box | 0.53 | 0.55 | | column | 1.55 | 1.56 | | signboard | 9.18 | 9.72 | | chest of drawers | 24.36 | 50.7 | | counter | 7.57 | 8.19 | | sand | 17.39 | 24.65 | | sink | 15.95 | 57.14 | | skyscraper | 25.64 | 36.46 | | fireplace | 22.39 | 33.4 | | refrigerator | 0.01 | 0.01 | | grandstand | 0.4 | 0.4 | | path | 5.51 | 7.08 | | stairs | 6.44 | 6.57 | | runway | 23.6 | 25.71 | | case | 6.62 | 8.7 | | pool table | 36.55 | 93.9 | | pillow | 22.26 | 30.48 | | screen door | 0.0 | 0.0 | | stairway | 2.1 | 2.11 | | river | 0.05 | 0.05 | | bridge | 0.0 | 0.0 | | bookcase | 6.45 | 6.74 | | blind | 0.12 | 0.12 | | coffee table | 6.59 | 6.85 | | toilet | 30.05 | 34.03 | | flower | 4.6 | 7.92 | | book | 18.98 | 21.75 | | hill | 0.0 | 0.0 | | bench | 0.0 | 0.0 | | countertop | 0.0 | 0.0 | | stove | 12.67 | 15.03 | | palm | 20.27 | 25.85 | | kitchen island | 0.0 | 0.0 | | computer | 24.2 | 31.78 | | swivel chair | 0.03 | 0.03 | | boat | 0.0 | 0.0 | | bar | 0.0 | 0.0 | | arcade machine | 0.03 | 0.03 | | hovel | 0.0 | 0.0 | | bus | 0.0 | 0.0 | | towel | 0.03 | 0.03 | | light | 17.14 | 18.92 | | truck | 0.0 | 0.0 | | tower | 0.0 | 0.0 | | chandelier | 19.3 | 25.6 | | awning | 0.0 | 0.0 | | streetlight | 0.0 | 0.0 | | booth | 0.0 | 0.0 | | television receiver | 7.93 | 8.05 | | airplane | 0.0 | 0.0 | | dirt track | 0.0 | 0.0 | | apparel | 0.0 | 0.0 | | pole | 0.0 | 0.0 | | land | 0.0 | 0.0 | | bannister | 0.0 | 0.0 | | escalator | 0.0 | 0.0 | | ottoman | 0.0 | 0.0 | | bottle | 0.15 | 0.15 | | buffet | 0.0 | 0.0 | | poster | 0.0 | 0.0 | | stage | 0.0 | 0.0 | | van | 0.0 | 0.0 | | ship | 0.0 | 0.0 | | fountain | 0.0 | 0.0 | | conveyer belt | 0.0 | 0.0 | | canopy | 0.0 | 0.0 | | washer | 0.73 | 0.73 | | plaything | 0.0 | 0.0 | | swimming pool | 0.0 | 0.0 | | stool | 0.0 | 0.0 | | barrel | 0.0 | 0.0 | | basket | 0.0 | 0.0 | | waterfall | 2.06 | 2.06 | | tent | 0.0 | 0.0 | | bag | 0.0 | 0.0 | | minibike | 0.45 | 0.45 | | cradle | 1.43 | 1.46 | | oven | 0.0 | 0.0 | | ball | 0.0 | 0.0 | | food | 0.0 | 0.0 | | step | 0.0 | 0.0 | | tank | 0.0 | 0.0 | | trade name | 0.0 | 0.0 | | microwave | 0.0 | 0.0 | | pot | 0.0 | 0.0 | | animal | 0.0 | 0.0 | | bicycle | 0.55 | 0.55 | | lake | 0.0 | 0.0 | | dishwasher | 0.0 | 0.0 | | screen | 0.0 | 0.0 | | blanket | 0.0 | 0.0 | | sculpture | 0.0 | 0.0 | | hood | 0.0 | 0.0 | | sconce | 0.0 | 0.0 | | vase | 0.0 | 0.0 | | traffic light | 0.0 | 0.0 | | tray | 0.0 | 0.0 | | ashcan | 0.0 | 0.0 | | fan | 0.0 | 0.0 | | pier | 0.0 | 0.0 | | crt screen | 0.0 | 0.0 | | plate | 0.1 | 0.1 | | monitor | 0.0 | 0.0 | | bulletin board | 0.0 | 0.0 | | shower | 0.0 | 0.0 | | radiator | 0.0 | 0.0 | | glass | 0.0 | 0.0 | | clock | 0.0 | 0.0 | | flag | 0.0 | 0.0 | +---------------------+-------+-------+ 2021-08-02 13:58:13,036 - mmseg - INFO - Summary: 2021-08-02 13:58:13,036 - mmseg - INFO - +-------+-------+-------+ | aAcc | mIoU | mAcc | +-------+-------+-------+ | 61.17 | 10.69 | 16.19 | +-------+-------+-------+

xiexinch commented 3 years ago

Hi @mhyu19 It seems that you have modified the dataset setting, can you show us your modification? It may help to locate your problem.

mhyu19 commented 3 years ago

1、刚开始并没有修改代码以及配置文件,训练测试结果出现nan. 2、于是我在pspnet_r18-d8_512x1024_80k_cityscapes.py中修改了:num_classes=1, 在mmseg/core/evaluation/class_names.py 中做如下修改: def cityscapes_classes(): """Cityscapes class names for external use.""" return ['sidewalk']

return [

#    'road', 'sidewalk', 'building', 'wall', 'fence', 'pole',
#    'traffic light', 'traffic sign', 'vegetation', 'terrain', 'sky',
#    'person', 'rider', 'car', 'truck', 'bus', 'train', 'motorcycle',
#    'bicycle'
#]

在datasets/cityspaces.py中做出以下修改: CLASSES =('sidewalk',)

CLASSES = ('road', 'sidewalk', 'building', 'wall', 'fence', 'pole',

#            'traffic light', 'traffic sign', 'vegetation', 'terrain', 'sky',
#            'person', 'rider', 'car', 'truck', 'bus', 'train', 'motorcycle',
#            'bicycle')

训练测试出的结果还是和1中的情况一样。 我想很可能是数据集的原因。 谢谢回答!

mhyu19 commented 3 years ago

重新获取数据集之后测试结果正常,是我数据的问题 图片

RoyZhDec commented 3 years ago

重新获取数据集之后测试结果正常,是我数据的问题

请问下重新获取数据集是什么操作呢?

mhyu19 commented 3 years ago

重新获取数据集之后测试结果正常,是我数据的问题

请问下重新获取数据集是什么操作呢?

重新下了cityscapes数据集

ke-dev commented 2 years ago

Hi, I have the same problem, has your problem been solved? @mhyu19

2807402145 commented 10 months ago

you must keep the value of mask is between 0 and num_class-1.