W4 A2 - Submission Error - "Can't Compile Student Code"

Hi All (and, hopefully, Moderators!),

All of my code has had the tests pass but when I try to submit my assignment I get the following error:

Cell #5. Can’t compile the student’s code. Error: TypeError(‘cannot unpack non-iterable NoneType object’)

Any thoughts on how to get around this?

Thanks!

After some problem solving with @Mubsi (who, by the way, is awesome) we found a solution.

If you get this error, you need to totally reboot your session (help > reboot) and start with a fresh notebook. I downloaded my finished script as an html and copy & pasted all of my work.

I hope this helps if you run into this.

2 Likes

Thank you for the kind words.

Happy learning!

Hi,
Thank you for the solution.
May I ask how to start a fresh notebook? because even if I reboot, it shows the saved version of my work. I don’t know how to go to the initial state.

I’m quoting @Mubsi here because I think he was a bit more clear…

"
go to “File–>Open…”, SAVE YOUR WORK ON YOUR LOCAL MACHINE, or rename the file. Then delete all the ipynb files and .py files (not the file you have renamed), then get a fresh copy of the assignment using the “Help” section on top right. Once you get the new copy try filling the new assignment using your previous and try submitting then.
"

I hope this helps.

1 Like

That worked. Thank you so much!

1 Like

I have passes all test got output but i am not being graded
it shows
Cell #3. Can’t compile the student’s code. Error: SyntaxError(‘EOF while scanning triple-quoted string literal’, (’/tmp/student_solution_cells/cell_3.py’, 31, 1295, ‘’’’\ntf.random.set_seed(10)\nbox_confidence = tf.random.normal([19, 19, 5, 1], mean=1, stddev=4, seed = 1)\nboxes = tf.random.normal([19, 19, 5, 4], mean=1, stddev=4, seed = 1)\nbox_class_probs = tf.random.normal([19, 19, 5, 80], mean=1, stddev=4, seed = 1)\nscores, boxes, classes = yolo_filter_boxes(boxes, box_confidence, box_class_probs, threshold = 0.5)\nprint("scores[2] = " + str(scores[2].numpy()))\nprint("boxes[2] = " + str(boxes[2].numpy()))\nprint("classes[2] = " + str(classes[2].numpy()))\nprint("scores.shape = " + str(scores.shape))\nprint(“boxes.shape = " + str(boxes.shape))\nprint(“classes.shape = " + str(classes.shape))\n\nassert type(scores) == EagerTensor, “Use tensorflow functions”\nassert type(boxes) == EagerTensor, “Use tensorflow functions”\nassert type(classes) == EagerTensor, “Use tensorflow functions”\n\nassert scores.shape == (1789,), “Wrong shape in scores”\nassert boxes.shape == (1789, 4), “Wrong shape in boxes”\nassert classes.shape == (1789,), “Wrong shape in classes”\n\nassert np.isclose(scores[2].numpy(), 9.270486), “Values are wrong on scores”\nassert np.allclose(boxes[2].numpy(), [4.6399336, 3.2303846, 4.431282, -2.202031]), “Values are wrong on boxes”\nassert classes[2].numpy() == 8, “Values are wrong on classes”\n\nprint(”\033[92m All tests passed!”)\n# END UNIT TESt\n’))

@TMosh and @paulinpaloalto can u please help?i did restart the kernal and updated my notebook but still same thing

I am currently off duty, and you would do better starting a new thread and not requesting specific mentors.