How does one initialize a variable with tf.get_variable and a numpy value in TensorFlow? : <p>I wanted to initialize some of the variable on my network with numpy values. For the sake of the example consider:</p>

<pre><code>init=np.random.rand(1,2)
tf.get_variable('var_name',initializer=init)
</code></pre>

<p>when I do that I get an error:</p>

<pre><code>ValueError: Shape of a new variable (var_name) must be fully defined, but instead was &lt;unknown&gt;.
</code></pre>

<p>why is it that I am getting that error? </p>

<p>To try to fix it I tried doing:</p>

<pre><code>tf.get_variable('var_name',initializer=init, shape=[1,2])
</code></pre>

<p>which yielded a even weirder error:</p>

<pre><code>TypeError: 'numpy.ndarray' object is not callable
</code></pre>

<p>I tried reading <a href="https://www.tensorflow.org/versions/r0.9/api_docs/python/state_ops.html#variable_scope" rel="noreferrer">the docs and examples</a> but it didn't really help.</p>

<p>Is it not possible to initialize variables with numpy arrays with the get_variable method in TensorFlow?</p>
