Course5 Week3 Assignment2 Exercise5

Much appreciate help on the below as I believe I’ve been following the assignment guidance correctly but when running the unit test of graded function modelf I get the following error when attempting to run the Dropout line after the first GRU layer:-

ValueError: Attempt to convert a value (<tensorflow.python.keras.layers.recurrent_v2.GRU object at 0x7fe0c436ad90>) with an unsupported type (<class ‘tensorflow.python.keras.layers.recurrent_v2.GRU’>) to a Tensor.

Selected screenshots of the error block as follows:-
image

The same error occurs regardless of the value of “rate” that I use (i note there is another question regarding whether the rate to use should be 0.8 or 0.2, and I’ve interpreted it should be 0.2)

Below also is a transcript of my code for the entire block defining “modelf”, thanks in advance for help on this:-

===

# UNQ_C5
# GRADED FUNCTION: modelf
 
# mentor edit: code removed.

Please don’t post your code on the Forum.

From the error message, at line 41 (in the Step 3 area), it appears you did not pass any data to the GRU layer.

Oh! I feel so foolish - have rectified and it all seems to work fine now, thanks for the help!