title: ValueError: Variable mlp-fc/weights does not exist, or was not created with tf.get_variable()
body: <p>I implemented multi-layer perceptrons (MLP) with one hidden layer using TensorFlow and got the following error when calling the function. Any help would be appreciated.</p>
  
  <pre><code>def MLP(x, option, dropout=1, prefix ='', num_outputs=1, reuse=None):
        weights = tf.random_uniform_initializer(-0.001, 0.001)
        biases = tf.constant_initializer(0.001, dtype=tf.float32)
  
        fc1 = tf.contrib.layers.fully_connected(tf.nn.dropout(x, keep_prob=dropout),
                         num_outputs=option.num_outputs, 
                         biases_initializer=biases,
                         weights_initializer = weights, 
                         activation_fn=tf.nn.relu, 
                         scope=prefix + 'fc', 
                         reuse=reuse)
        logits = tf.contrib.layers.linear(tf.nn.dropout(fc1, keep_prob=dropout),
                         num_outputs=num_outputs,
                         biases_initializer=biases,
                         weights_initializer = weights,
                         scope=prefix + 'l',
                         reuse=reuse)
  
  return logits
  
  logits = MLP(x, option, dropout=dp, prefix='mlp-', reuse=True)
  </code></pre>
  
  <p><strong>ValueError: Variable mlp-fc/weights does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=tf.AUTO_REUSE in VarScope?</strong></p>
  
  <p>I tried to initialize the weights and set the weights_initializer but still got the same error.</p>