image-segmentation-keras
image-segmentation-keras copied to clipboard
Metric changes
Is there a way to change the metric from accuracy to a custom metric like iou?
I changed train.py to have
model.compile(loss=loss_k, optimizer=optimizer_name, metrics=[iou]) #replaced accuracy with iou
where i defined iou as def iou(y_true, y_pred): intersection = K.sum(y_true * y_pred) sum_ = K.sum(y_true + y_pred) jac = (intersection + smooth) / (sum_ - intersection + smooth) return jac
It trains but it still says "accuracy" while training. When I change it to the following, it still doesn't show both. Just accuracy. Is there other changes to train i missed?
model.compile(loss=loss_k, optimizer=optimizer_name, metrics=['accuracy', iou])
Even this doesn't do anything. model.compile(loss=loss_k, optimizer=optimizer_name, metrics=[tf.keras.metrics.MeanIoU(num_classes=2)])
Same problem.
Hey Guys,
I know it's little bit late but got also a really strange behavior. When I'm using my Ubuntu workstation meanIOU (from Keras metrics) works really fine. It's displayed and could be used for early stopping. (Keras 2.4.3) (Just import and add to metrics list)
But on my MacbookPro training is not even starting.
Any ideas?