C2_W3_lab - AssertionError: Use the TensorFlow API

In the lab’s exercise 1 I am getting an error that is C2_W3_lab(improving deep NN-Week3) - AssertionError: Use the TensorFlow API, even tough I am using Tensorflow API.
what I did -

Moderator Edit: Solution Code Removed

followed by W and b but using tf.Variable
then finally -

Moderator Edit: Solution Code Removed

to be sure that I am doing right I checked the type of Y which came out to be -
print('type :',type(Y))

type : <class 'tensorflow.python.framework.ops.EagerTensor'>

Please help me with what I am doing wrong

Hello @Sheikh_Taha_Maroof!

Please note that sharing your code is not allowed by the community code of conduct. So, avoid sharing your code. Instead, share your full error.

My bad! for the reason, I tried to write as less as I could to explain my code. I will keep in mind to share as less code as possible

Please share your full error, if still facing any problem…

As I mentioned, I am only getting 1 line of error -
AssertionError Traceback (most recent call last)
2 print(result)
----> 4 assert type(result) == EagerTensor, “Use the TensorFlow API”
5 assert np.allclose(result, [[-2.15657382], [ 2.95891446], [-1.08926781], [-0.84538042]]), “Error”
6 print(“\033[92mAll test passed”)

AssertionError: Use the TensorFlow API

Thanks for sending me your code @Sheikh_Taha_Maroof!

It is very critical to do your code between comment lines # YOUR CODE STARTS HERE and # YOUR CODE END HERE and do not change the rest of the code. Even adding a comma (,) outside of this space, like after the return statement (return Y,) will give you an unexpected error…

1 Like

Thanks for resolving my silly bug. sir. After removing the comma now it’s working just fine. Thank you very much.