but this line n_classes = 1 if len(CLASSES) == 1 else (len(CLASSES) + 1) adds one more class.
If I keep the settings as default in the notebook, I have n_classes=6 but then during training, I get randomly other shape mismatch errors. In this case, I got this
Incompatible shapes: [1,384,480,6] vs. [1,48,1]
[[{{node loss/softmax_loss/binary_focal_loss_plus_dice_loss/mul_6}}]]
at the end of the first epoch but this error happens at a different times when I change the validation_steps
# define optimizer
optim = keras.optimizers.Adam(LR)
# actulally total_loss can be imported directly from library, above example just show you how to manipulate with losses
total_loss = sm.losses.categorical_focal_dice_loss
metrics = [sm.metrics.IOUScore(threshold=0.5), sm.metrics.FScore(threshold=0.5)]
# compile keras model with defined optimozer, loss and metrics
model.compile(optim, total_loss, metrics)
Hey, I know it has been asked before but I couldn't figure out a solution to my problem.
I have 5 classes and I define them like that :
CLASSES = ['facade', 'window', 'obstacle', 'sky', 'door']
but this line
n_classes = 1 if len(CLASSES) == 1 else (len(CLASSES) + 1)
adds one more class.If I keep the settings as default in the notebook, I have
n_classes=6
but then during training, I get randomly other shape mismatch errors. In this case, I got thisat the end of the first epoch but this error happens at a different times when I change the validation_steps
I use:
And my loss
My shapes:
Any help would be appreciated!