import tensorflow as tf
{Moderator Edit: Solution Code Removed}
Can somebody plz assist me why I am getting this error:
AssertionError: Wrong output. Use tf.one_hot
import tensorflow as tf
{Moderator Edit: Solution Code Removed}
Can somebody plz assist me why I am getting this error:
AssertionError: Wrong output. Use tf.one_hot
Sharing your code is against the community code of honor. Instead of sharing your code, please share your full error.
Regarding your query, you also have to specify the correct axis in tf.one_hot
. Also, you only have to replace the None
with the correct terms and do not change the rest of the terms.
Best,
Saif.
I am really sorry, It was my first time .
Below is Error I am getting:
AssertionError Traceback (most recent call last)
in
14 print(“\033[92mAll test passed”)
15
—> 16 one_hot_matrix_test(one_hot_matrix)
in one_hot_matrix_test(target)
5 print(“Test 1:”,result)
6 assert result.shape[0] == depth, “Use the parameter depth”
----> 7 assert np.allclose(result, [0., 1. ,0., 0.] ), “Wrong output. Use tf.one_hot”
8 label_2 = [2]
9 result = target(label_2, depth)
AssertionError: Wrong output. Use tf.one_hot
I am still unable to understand the error
This is the solution.
I provide axis=0, but still getting same error:
AssertionError: Wrong output. Use tf.one_hot
Because you are changing the code which you are not supposed to change. Only change the None
and don’t touch the rest of the code.
{Moderator Edit: Solution Code Removed}
Still getting same error:
AssertionError: Wrong output. Use tf.one_hot
Think about it. You have changed it.