'Dense' object has no attribute 'op'

{moderator edit - solution code removed}

i keep having this error ‘Dense’ object has no attribute ‘op’
any help ?

Please don’t post your code on the Forums. That breaks the Honor Code.
You aren’t passing any data parameters to the layers.

Just calling ReLU() like that returns you the ReLU function. So A1 will be a function, not a tensor. You need to pass an input tensor to the resulting ReLU() function. Tom’s point is that you have made the exact same mistake on every line that you showed: you create the functions, but you don’t actually invoke (call) them an input tensor.

Here’s an earlier thread that may shed some light.


i made the references such as A1 = tf…()(Z1) and outputs = tf…(…)(F) now iam getting this error

(Attempt to convert a value (<tensorflow.python.keras.layers.convolutional.Conv2D object at 0x7f7cf4c34ad0>) with an unsupported type (<class ‘tensorflow.python.keras.layers.convolutional.Conv2D’>) to a Tensor.)

solved ,
i forgot some references
thanks for the replies ,

Can you help me? I am still stuck at it

check your functions ,everyone should be applied on something , ES A1 = tf…()( Z1 ) and outputs = tf…(…)( F )

i have applied what you said but i am still getting that same error

Sorry, but this thread has a lot of entries on it. It’s not clear which thing you are replying to.

Please show us the actual exception trace that you are getting. Just “copy/paste” the output. But be careful to use the </> tool so that it formats correctly.