Hi,
i uploaded my notebook file with the model achieved training accuracy more than 99% and the validation accuracy more than 98%.
During the development, i used the following lines for ensuring the categorical model building:
training_labels = to_categorical(training_labels, num_classes=25)
validation_labels = to_categorical(validation_labels, num_classes=25)
Otherwise, during the building process i received the error: ValueError: Shapes (None, 1) and (None, 25) are incompatible
My notebook grade is 89/100 with the following error:
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: in user code: File “/opt/conda/lib/python3.7/site-packages/keras/engine/training.py”, line 1366, in test_function * return step_function(self, iterator) File “/opt/conda/lib/python3.7/site-packages/keras/engine/training.py”, line 1356, in step_function ** outputs = model.distribute_strategy.run(run_step, args=(data,)) File “/opt/conda/lib/python3.7/site-packages/keras/engine/training.py”, line 1349, in run_step ** outputs = model.test_step(data) File “/opt/conda/lib/python3.7/site-packages/keras/engine/training.py”, line 1306, in test_step y, y_pred, sample_weight, regularization_losses=self.losses) File “/opt/conda/lib/python3.7/site-packages/keras/engine/compile_utils.py”, line 201, in call loss_value = loss_obj(y_t, y_p, sample_weight=sw) File “/opt/conda/lib/python3.7/site-packages/keras/losses.py”, line 141, in call losses = call_fn(y_true, y_pred) File “/opt/conda/lib/python3.7/site-packages/keras/losses.py”, line 245, in call ** return ag_fn(y_true, y_pred, **self._fn_kwargs) File “/opt/conda/lib/python3.7/site-packages/keras/losses.py”, line 1665, in categorical_crossentropy y_true, y_pred, from_logits=from_logits, axis=axis) File “/opt/conda/lib/python3.7/site-packages/keras/backend.py”, line 4994, in categorical_crossentropy target.shape.assert_is_compatible_with(output.shape) ValueError: Shapes (None, 1) and (None, 25) are incompatible .
Could someone explain me what is the error and what is the problem with the notebook?