FYI: I had to modify the code for “model”, which doesn’t contain any instructions to do so, by inserting the two tf.squeeze calls in the line below:
minibatch_cost = compute_cost(tf.squeeze(Z3), tf.squeeze(minibatch_Y))
This yielded the expected result. The lab should probably be changed or some other clarification added.