By the way I think for segmentation it’s probably easier (and more correct) to use the “DICE” metric, which is actually designed to aggregate accuracy across the whole image.
DICE already takes the input tensor shape into account, so you can use the vanilla metric
You are a lifesaver! Thank you so much! I would never have thought to make a custom accuracy metric or known how to go about making one. Yours worked perfectly
Would it be okay if I messaged you directly if I get stuck again?