C2_W4 Submission Error - Resolved

I have created the model in Colab, and it is working fine with val accuracy of 0.98
I submitted the solution but received a score of 89 out of 100.
Below is the graded output:

All tests passed for parse_data_from_input!

All tests passed for train_val_generators!

Details of failed tests for create_model

Failed test case: your model could not be used for inference. Details shown in ‘got’ value below:.
Expected:
no exceptions,
but got:
Received a label value of 24 which is outside the valid range of [0, 8). Label values: 2 13 4 6 5 6 4 15 11 10 13 2 3 2 7 14 16 14 0 18 22 20 16 23 18 15 12 8 1 7 10 4 10 3 3 5 15 7 2 5 7 2 7 8 13 14 24 3 21 13 17 5 10 17 0 22 0 21 23 0 7 19 7 7 19 21 10 4 21 17 19 20 20 2 14 7 4 8 12 20 15 21 2 8 21 0 21 11 3 22 22 4 15 15 4 23 8 1 1 7
[[node sparse_categorical_crossentropy/SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits
(defined at /opt/conda/lib/python3.7/site-packages/keras/backend.py:5114)
]] [Op:__inference_test_function_409]

Can someone please help here, what i am missing?

Please click my name and message your notebook as an attachment.

1 Like

Thanks for your response.
I found the error, in the output layer of the model, I provided the number of neurons = the number of unique labels.
But after hard-coding the neurons as 25 in the output layer, error was fixed.

Thank you.