MichaelFan01 / STDC-Seg

Source Code of our CVPR2021 paper "Rethinking BiSeNet For Real-time Semantic Segmentation"
MIT License
703 stars 131 forks source link

Nice work!请问我们减少其中一个类别,在训练过程中的val阶段报错 #92

Closed hankerbit closed 1 year ago

hankerbit commented 1 year ago

it: 50/40000, lr: 0.008710, loss: 8.7523, boundery_bce_loss: 0.4964, boundery_dice_loss: 0.9156, eta: 7:44:27, time: 34.1801 ==> warmup done, start to implement poly lr strategy it: 100/40000, lr: 0.009989, loss: 6.8274, boundery_bce_loss: 0.1632, boundery_dice_loss: 0.7458, eta: 7:32:47, time: 33.2269 evaluating the model ... setup and restore model compute the mIOU 0%| | 0/250 [00:00<?, ?it/s]Traceback (most recent call last): File "/home/lj/rail_segment/STDC-Seg/train_ref_railsem.py", line 470, in train() File "/home/lj/rail_segment/STDC-Seg/train_ref_railsem.py", line 423, in train mIOU50 = single_scale1(net, dlval, n_classes) File "/home/lj/rail_segment/STDC-Seg/evaluation.py", line 64, in call ).view(n_classes, n_classes).float() RuntimeError: shape '[18, 18]' is invalid for input of size 338 0%| | 0/250 [00:00<?, ?it/s]

用trainId=255, 屏蔽其中一个类别,采用18累训练(对应的n_classes也设置为18),出现以上错误。 请问是什么原因? 感谢

hankerbit commented 1 year ago

删掉json文件中 trainId=-1的类,在修改类别数量就可以了