Tensorflow Assignment: Passed all previous tests but training function raises a Warning

My code passed all previous tests, but when I execute the cell in which the model is trained (function “model”), without modifying it, the output is:

WARNING:tensorflow:Gradients do not exist for variables [‘Variable:0’, ‘Variable:0’, ‘Variable:0’, ‘Variable:0’] when minimizing the loss.

For all epochs. What might the problem be?

Hi @Sara_Valiente,

Can you share your lab ID with me ? In the assignment, when you click the top right “Help” button, a panel will open and your lab ID will be shown at the bottom.
I shall take a look.

When you reply back, kindly tag me in the post so that I’m notified.

Thanks,
Mubsi

Hello @Mubsi,

Thank you for your reply. The id of the lab is: wkftkzki.

Kind regards,

Sara

Hi @Sara_Valiente,

Your issue lies in Ex 5.

Firstly, you have introduced a variables A3 in the function, which if you look at the code skeleton, it is not required. You only need to compute Z1, A1, Z2, A2 and Z3.

And for some of the above mentioned variables, you are making them a tf.Variable, which again, is not required.

Cheers,
Mubsi

Thank you for the clarification, @Mubsi. The epochs are shown now, however I do not quite understand how those errors affected to the network, since the function of Ex.5 just returned the parameter Z3. Does the way in which we set variables (tf.Variable(tf.keras.activations.relu(Z1)) vs tf.keras.activations.relu(Z1)) really affect that much?

Kind regards,

Sara