Hi,
Before submitting C2W4 Assignment, I ran my model without error messages. However after I submitted the assignment I got the following grader output:
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
It looked like coding error. I ran my model again and again, no error messages popped out. I lost 11% because of this. Could anyone explain what happened?
Thanks.