C3W2A Assignment - Fail even though passed all unit tests but training stops after epoch 197

The code passes all unit tests and training continues through 197 of 200 epochs:

For some reason, the training isn’t going through all 200 epochs as specified:

image

So I submit my assignment for grading and fail. Twice I’ve closed down, re-booted, restarted brower, run the assignment (All cells), but the assignment only generates the 197-epoch version which fails when submitted.

I also renamed the assignment, downloaded and opened the latest notebook, and then entered the code into it. It again stopped after the 197th epoch and failed the grader. However, the results on that 197th epoch this time were quite impressive (human-indicated cell borders above, U-Net identified cell borders below):

Please let me know how to successfully complete this assignment.

Thanks!

1 Like

Hi Jswat!

What is the grader’s message?
Also, try clearing/deleting the last output and try to submit, see what happens (Only the code and the unit test cases matter).

Regards,
Nithin

Hi Nithin,

Nice that I’m nearly through both the Deep Learning and GAN specialization and this is the first grade fail!

The grader error (again, a first for me) is: Cell #5. Can’t compile the student’s code. Error: TypeError(“‘builtin_function_or_method’ object is not iterable”,)

Cell #5 is the unit test for Cell #4 which is UNQ_C2 crop function. I wrote it using center_crop imported from torchvision.transforms.functional; I used only 2 lines of code for that cell.

As you suggested I also restarted the kernel and cleared output, then ran only the cells up to the train() cell but didn’t run train() or any cells after. I submitted that version and got the same error message: Cell #5. Can’t compile the student’s code. Error: TypeError(“‘builtin_function_or_method’ object is not iterable”,)

Thanks for coordinating on this.
Jeff

Just found another discussion that implies the issue is a Pytorch/Python versioning issue but with no posted resolution: C3W2A_Assignment Center Cropping - #11 by Giorgio_Ballardin

Hi Jswat!

The problem is due to a version mismatch! CenterCrop() doesn’t work with grader. All you need to do is slice the matrices directly without the use of CenterCrop() for now.
Take a look at this thread, hope this will clear your issues. If not, let us know.

Regards,
Nithin