Hi,
In my C2W4 assignment, I did used one-hot encoding and my model was able to be run achieving 99% training accuracy and 99% validation accuracy. But when I submitted the assignment, I got 89% with grader notes that said that there was an error as follows: - I think this was an error? Please advise.
======================================================
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, 26) are incompatible
.