C2W4:[Classification: Beyond two classes ]
Getting the following error when architecture check piece of code is executed.
Your model is not compatible with the dataset you defined earlier. Check that the loss function, last layer and label_mode are compatible with one another. I had checked the mentioned parameters
loss function = categorical_crossentropy, last layer = (24, and activation is softmax) and label_mode = categorical
Always share a screenshot of the error you are getting as it gives hints towards where to look for debugging.
but please make sure you do not post any grade cell codes here.
Regards
DP
this means your codes are incorrect with previous grade cell, kindly go back and check if you recalled the codes correctly for all mentioned parameters mentioned in the screenshot.
it is pointing if your loss is correct, so what loss did you use for this classification? did you try changing optimizer and work around?
But I suspect more than just loss, your previous grade cell also has issue, did you pass previous test cells?
I have sent you DM
You need to use simple model and do not add data augmentation model into your model as the previous grade cell is task where you create tf.keras.dataset which creates your training and validation dataset.
Next recheck your parameters for the model compile statement as it is a multiclassification with different features, so using loss of categorical is incorrect. use sparse categorical crossentropy as loss
Next in the train_val_dataset, label should ‘int’ rather than categorical.
another mistake, your feature class is 26 and not 24, so your last dense layer unit also need that correct.
Honestly I would advise you to get a fresh copy and re-do the assignment as you already have a kernel warning.
Regards
DP