lattice-ai / DeepLabV3-Plus

Tensorflow 2.3.0 implementation of DeepLabV3-Plus
https://keras.io/examples/vision/deeplabv3_plus/
101 stars 23 forks source link

MeanIoU metric gives ValueError #49

Open Barthas255 opened 1 year ago

Barthas255 commented 1 year ago

Hi, Im testing DeepLabV3+ for 2 class segmentation task and wanted to change the metric. Accuracy is pretty useless in my scenario, since I'm trying to detect buldings on orthophotomap, and the rest is just background. But when I try to change metric to IoU (or MeanIoU) I'm welcomed with this ValueError:

image image

I tried looking for the answer on the internet, wasn't successful. I tried to implement my own IoU like this:

image

but this sometimes gives values outside of range (0,1), which is bad. Also I believe somehow y_pred and y_true don't have the same dimensions, which is odd for me:

image

I might be missing something obvious Any solutions?

DoraPist commented 1 year ago

Hello everyone! I have the same issue... I would like to use MeanIoU as a metric, but I get the above error too. If someone knows how to solve it, please, let an answer here. It would be very helpful. Thank you in advance!