Week3_Tensorflow_Assignment_EX_4

Whats going on here? Isn’t variable an already defined attribute?

My code:

W1 = tf.variable(initializer(shape=(25,12288)))
b1 = tf.variable(initializer(shape=(25,1)))
W2 = tf.varaible(initializer(shape=(12,25)))
b2 = tf.variabel(initializer(shape=(12,1)))
W3 = tf.variable(initializer(shape=(6,12)))
b3 = tf.variable(initializer(shape=(6,1)))

ERROR message:

AttributeError Traceback (most recent call last)
in
18 print("\033[92mAll test passed")
19
—> 20 initialize_parameters_test(initialize_parameters)

in initialize_parameters_test(target)
1 def initialize_parameters_test(target):
----> 2 parameters = target()
3
4 values = {“W1”: (25, 12288),
5 “b1”: (25, 1),

in initialize_parameters()
24 # b3 = …
25 # YOUR CODE STARTS HERE
—> 26 W1 = tf.variable(initializer(shape=(25,12288)))
27 b1 = tf.variable(initializer(shape=(25,1)))
28 W2 = tf.varaible(initializer(shape=(12,25)))

AttributeError: module ‘tensorflow’ has no attribute ‘variable’

Hi @Zekromblue , consider that python is as Case Sensitive language. Check how are you calling the different methods.

1 Like

Hmm, I still cant see what I’m doing wrong

wait I think I got it, needs to be capital V in variable. Thank you so much!

Ah but looks like changing that didnt work either. :confused: sill getting the same error.
module ‘tensorflow’ has no attribute ‘Varaible’

It worked! Thank you for the resolution.