C1_W_4 Task 5 'TypeError: align_embeddings() got an unexpected keyword argument 'verbose''

The output of my code is same as expected but after assignment submission i receive: TypeError: align_embeddings() got an unexpected keyword argument ‘verbose’. I tried rebooting the kernel, double checked everything but still same error.

Did you change the definition of the align_embeddings function? Here’s what it looks like as given to you in the template code:

def align_embeddings(X, Y, train_steps=100, learning_rate=0.0003, verbose=True, compute_loss=compute_loss, compute_gradient=compute_gradient):

Notice that it does have an optional “keyword” argument verbose. Changing the definition of functions is generally a risky thing to do …

Did you copy that code from an old version of the notebook from someplace? That is a very different definition than what I showed, so there is an obvious incompatibility here. If you got a solution from GitHub, please realize that a) that is cheating and b) it doesn’t work if the solution is too old. The assignments in most of the courses here change over time.

I suggest you get a clean copy of the assignment and start over.

Or maybe you are somehow in a different older version of the course than I’m seeing, but then it’s clear that the grader in your version of the course is expecting to be able to pass the verbose argument to that function. So I’m not sure what the theory is, but please try the “fresh copy” procedure and see what the function looks like there.

I explained you already that the code segment is not editable. How can I copy or paste something here. I tried loading latest version of lab but still the same error. I don’t know if I have an older version of lab. What I can do in this situation?

It is a function where you need to fill in the contents, so how could it possibly work if that cell is not editable? You can see in the code you showed that you have filled in the “YOUR CODE HERE” sections. So how did that happen?

Something is very wrong here. Did you actually get a clean copy? Or did it just stay the same? If the latter, then that simply means you did not follow the instructions correctly. You have to move the existing notebook aside first, right? For safety, the procedure will not overwrite existing files.

How can I restart everything like writing everything from start again?

I gave you the link with instructions in my earlier response on this thread. Here it is again. Please read it carefully and it shows you how to rename your existing notebook out of the way and get a clean copy. Then you can “copy/paste” just your solutions into the clean notebook if you like or you can literally just start over from scratch in the clean copy.

Thank you. This time I will be more careful.

Thank you @paulinpaloalto. The issue is resolved now. Your support was very helpful.