My guess is that custom loss function is the culprit. Try to train the model with a crossentropy loss.
Also you can read this discussion of dice loss: python - Implementing Multiclass Dice Loss Function - Stack Overflow 2