title: ValueError("No variables provided.") in apply_gradients of optimize.py
body: <p>In <a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/training/optimizer.py" rel="nofollow noreferrer">optimizer.py</a>, the first part of code segment is</p>
  
  <pre><code>def apply_gradients(self, grads_and_vars, global_step=None, name=None):
  
     grads_and_vars = tuple(grads_and_vars)  # Make sure repeat iteration works.
     if not grads_and_vars:
        raise ValueError("No variables provided.")
  </code></pre>
  
  <p>Running my program, I got the error message caused by this specific error. I then printed out <code>tuple(grads_and_vars)</code>, part of which is. I don't know why it can cause the error of <code>no variables provided</code>.</p>
  
  <pre><code>((&lt;tf.Tensor 'Optimizer/training/clip_by_global_norm/Optimizer/training/clip_by_global_norm/_0:0' shape=(3, 3, 3, 64) dtype=float32&gt;, &lt;tensorflow.python.ops.variables.Variable object at 0x2afc746b5c50&gt;), (&lt;tf.Tensor 'Optimizer/training/clip_by_global_norm/Optimizer/training/clip_by_global_norm/_1:0' shape=(64,) dtype=float32&gt;, &lt;tensorflow.python.ops.variables.Variable object at 0x2affd48189b0&gt;), (&lt;tf.Tensor 'Optimizer/training/clip_by_global_norm/Optimizer/training/clip_by_global_norm/_2:0' shape=(3, 3, 64, 64) dtype=float32&gt;, &lt;tensorflow.python.ops.variables.Variable object at 0x2affd486d940&gt;), (&lt;tf.Tensor 'Optimizer/training/clip_by_global_norm/Optimizer/training/clip_by_global_norm/_3:0' shape=(64,) dtype=float32&gt;, &lt;tensorflow.python.ops.variables.Variable object at 0x2affd488cf98&gt;), (&lt;tf.Tensor 'Optimizer/training/clip_by_global_norm/Optimizer/training/clip_by_global_norm/_4:0' shape=(3, 3, 64, 128) dtype=float32&gt;, &lt;tensorflow.python.ops.variables.Variable object at 0x2afc746b5d68&gt;), (&lt;tf.Tensor 'Optimizer/training/clip_by_global_norm/Optimizer/training/clip_by_global_norm/_5:0' shape=(128,) dtype=float32&gt;, &lt;tensorflow.python.ops.variables.Variable object at 0x2affd48f4278&gt;), (&lt;tf.Tensor 'Optimizer/training/clip_by_global_norm/Optimizer/training/clip_by_global_norm/_6:0' shape=(3, 3, 128, 128) dtype=float32&gt;, &lt;tensorflow.python.ops.variables.Variable object at 0x2affd4915e10&gt;), 
  </code></pre>