Hello! I hope you are doing well.
I am stuck in DLS_C4_W1_Assign2_Exercise 2 - convolutional_model. Getting this error:
OperatorNotAllowedInGraphError: using a tf.Tensor
as a Python bool
is not allowed in Graph execution. Use Eager execution or decorate this function with @tf.function.
I tried to find the solution here in a community and no one faced that error. However, I found that someone shared the whole code of that exercise, I copied that and passed all test.
But I am curious to know the following things:
- Given that tfl.Conv2D(filters= … , kernel_size= … , padding=‘same’)(input_img). What is happening between these two brackets? One bracket with
**kwargs
and another withinput_img
. This guide only shows one bracket. - Previously, I did
ReLU(Z1)
and got error butReLU()(Z1)
is correct. What is difference between these two. Relu guide shows only one bracket.
I passed this assignment by copying code from here. However, I am curious to know about the above error and two points. And admin! need to delete the code from where I copied.
Saif.