Error in mapping one hot encode function to dataset

Output in grader results in
“Cell #4. Can’t compile the student’s code. Error: TypeError(“in converted code:\n\n\n TypeError: tf__my_one_hot() missing 1 required positional argument: ‘label’\n”,)”

Here is my code for mapping one hot encode function to dataset

Error description given

Are there any suggestions to solve this problem?
Thanks in advance.


The my_one_hot function expects two parameters - feature and label if you see the function signature.
I would recommend checking your tfds.load syntax (and its documentation page), so you load it a tuple of (feature, label) rather than loading dictionary of entire dataset.

Hi @gopiramena thank you for your response and already solved

Hey! Tell me how did you solve this problem? I can’t decide, already tried all the tips! Thank you!

Hey! I have the same problem, But I can’t decide, I don’t have any arguments, the arguments are not marked in the program yet, but I have to pass two arguments! please help me