Hello everyone.
In Code Cell UNQ_C1: Function ‘compute_content_cost’ , I computed the cost and it runs correctly with no error, but after I submit my assignment i can not get my grade for this function.
I paste my code and grade output below:
My code:
{moderator edit - solution code removed}
Grader output:
Code Cell UNQ_C1: Function ‘compute_content_cost’ is incorrect. Check implementation.
Code Cell UNQ_C2: Function ‘gram_matrix’ is correct.
Code Cell UNQ_C3: Function ‘compute_layer_style_cost’ is correct.
Code Cell UNQ_C4: Function ‘total_cost’ is correct.
Code Cell UNQ_C5: Function ‘train_step’ is correct.
If you see many functions being marked as incorrect, try to trace back your steps & identify if there is an incorrect function that is being used in other steps.
This dependency may be the cause of the errors.
Thank you for your helping.
Best regards.
There’s a section in the notebook that lists grader gotchas.
If you have followed all instructions in the section below (including resetting your workspace), please click my name and message your notebook as an attachment.
Important Note on Submission to the AutoGrader
Before submitting your assignment to the AutoGrader, please make sure you are not doing the following:
- You have not added any extra
print
statement(s) in the assignment.
- You have not added any extra code cell(s) in the assignment.
- You have not changed any of the function parameters.
- You are not using any global variables inside your graded exercises. Unless specifically instructed to do so, please refrain from it and use the local variables instead.
- You are not changing the assignment code where it is not required, like creating extra variables.
If you do any of the following, you will get something like, Grader not found
(or similarly unexpected) error upon submitting your assignment. Before asking for help/debugging the errors in your assignment, check for these first. If this is the case, and you don’t remember the changes you have made, you can get a fresh copy of the assignment by following these instructions.
1 Like
You have to be careful with type coercion rules in TF. It’s a bit more strict than straight numpy. Notice that all the values in the denominator there are integer types, so that may not have the effect that you want. Try using 4. instead of just 4 in that expression and see if that works better. Those are not the same thing in python, right? Using the former will coerce the type of the expression to float, which is pretty key here.
If that’s not enough to fix the problem, you might also consider tf.subtract instead of the simpler expression you used for the subtraction. Not sure if that “overloaded” operator gives you the right result for TF.
But my money is on the integer type coercion …
Hey,
Although I get no error when i run the exercises and pass all the tests, the grader gives me 80/100 together with the following error:
“Code Cell UNQ_C1: Unexpected error (AttributeError(”‘list’ object has no attribute ‘get_shape’“)) occurred during function check. We expected function compute_content_cost
to return compute_content_cost test 1 failed. Please check that this function is defined properly.”
I did use get_shape but it is also recommended in assigment. Besides I dont have any list object in the code. The arguments of this function are tensors.
Thanks in advance