Hello!
I am getting a huge error message while my output matches the expected output.
Here is my output:
tf.Tensor(
[[0.]
[1.]
[0.]
[0.]], shape=(4, 1), dtype=float32)
Here is the error message:
`InvalidArgumentError Traceback (most recent call last)
in
12 print("\033[92mAll test passed")
13
—> 14 one_hot_matrix_test(one_hot_matrix)
in one_hot_matrix_test(target)
7 assert result.shape[1] == 1, f"Reshape to have only 1 column"
8 assert np.allclose(result, [[0.], [1.], [0.], [0.]] ), “Wrong output. Use tf.one_hot”
----> 9 result = target(3, depth)
10 assert np.allclose(result, [[0.], [0.], [0.], [1.]] ), “Wrong output. Use tf.one_hot”
11
in one_hot_matrix(label, depth)
15 # YOUR CODE STARTS HERE
(deleted)
19 # YOUR CODE ENDS HERE`
…
/opt/conda/lib/python3.7/site-packages/tensorflow/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
58 ctx.ensure_initialized()
59 tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
—> 60 inputs, attrs, num_outputs)
61 except core._NotOkStatusException as e:
62 if name is not None:
InvalidArgumentError: Input to reshape is a tensor with 4 values, but the requested shape has 12 [Op:Reshape]
Any ideas? I have difficulties with this package.
Thanks in advance


