I get, all tests passed, though under train_step the expected values look slightly different
tf.Tensor(10221.224, shape=(), dtype=float32) tf.Tensor(6081.4204, shape=(), dtype=float32) All tests passed
However the autograger gives 80% and in the diagnosis I see We expected function train_step to return train_step test 1 failed. Please check that this function is defined properly. in the grader output.
This the output of my autograder
Code Cell UNQ_C1: Function ‘compute_content_cost’ is correct.
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: Unexpected error (TypeError(‘in user code:\n\n /tmp/student_solution_cells/cell_26.py:56 train_step *\n grad = tape.gradient(J, generated_image)\n /usr/local/lib/python3.7/site-packages/tensorflow/python/eager/backprop.py:1034 gradient **\n if not backprop_util.IsTrainable(t):\n /usr/local/lib/python3.7/site-packages/tensorflow/python/eager/backprop_util.py:30 IsTrainable\n dtype = dtypes.as_dtype(dtype)\n /usr/local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:650 as_dtype\n (type_value,))\n\n TypeError: Cannot convert value None to a TensorFlow DType.\n’)) occurred during function check. We expected function train_step to return train_step test 1 failed. Please check that this function is defined properly.
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.
This is not exactly related by get this error on the same function : NameError: name 'J_style_layer' is not defined. Can you help me? The compute_style_cost and compute_layer_style_cost work fine.