title: TypeError: __init__() got an unexpected keyword argument 'shape'
body: <p>I am new to Tensorflow and I met an error while trying to run some sample codes.</p>
  
  <pre><code>import tensorflow as tf
  
  g1 = tf.Graph()
  with g1.as_default():
      v = tf.get_variable("v", initializer=tf.zeros_initializer(shape=[1]))
  </code></pre>
  
  <p>Running the code above gives the error:
  TypeError: __init__() got an unexpected keyword argument 'shape'.</p>
  
  <p>The comment below says that tf.zeros_initializer does not accept 'shape' argument according to the documentation. I tried</p>
  
  <pre><code>v = tf.get_variable("v", initializer=tf.zeros_initializer())
  </code></pre>
  
  <p>and it says ValueError: Shape of a new variable (v) must be fully defined, but instead was .</p>
  
  <p>So, what kind of argument/expression should I use to define the shape without causing a type error?</p>
  
  <p>I cannot find how to solve it online. Please help. Thank you</p>