Too many values to unpack (expected 2) -can someone point me towards previous lectures on one-hot encoding?

Hi Folks,
im stuck on the week1 exercise for 3 weeks now:

Step 3 - Mapping one hot encode function to dataset

Previously all cells compiled, but grader does not accept it so i am re writing some cells to see if it makes any difference. I recall Laurence Maroney did some one hot encoding videos in one of the many deep learning courses. i cant find this . Does anyone know where it is?

My dataset mapping attempt…
_,train_data = train_data.map(lambda image,label: my_one_hot(image,label))
fails with…

too many values to unpack (expected 2)

many thanks in advance!

Check how many outputs that function is returning; it should return 2. It might be returning a list on which you are appending items, and that might exceed the limit of 2 sometimes!

That’s probably the TF Developer Specialization (the first one)!

Also, if you modified the notebook in the cells you are not supposed to, you better get a reset version and start working on it!

1 Like

I fixed this , thanks.So cell 4 executes in jupyter. The map function returns a dataset (not a tuple) my mistake. I still have the cell3 issue with the grader.

By the way, is there a way to start over from a completely fresh copy of this exercise? I dont seen an option for this. New notebook starts with a blank notebook.

its ok - i found a post on hwo to do this. i have rest the notebook to start this exercise again

1 Like

i reset the notebook and it passed first time. What a waste of 3 weeks. I have a suspicion it was to do with filePath = f"{getcwd()}/data" . I may have inadvertently changed this to ‘filepath’ in the previous version.
Thank you for your time on this.
C

1 Like