title: Unable to use summary.merge in tensorboard for separate training and evaluation summaries
body: <p>I am trying to use tensorboard to watch the learning of a convolutional neural net. I am doing good with the tf.summary.merge_all function to create a merged summary. However, I would like to have tracking on accuracy and loss both for training and test data. This post is useful:<a href="https://stackoverflow.com/questions/34471563/logging-training-and-validation-loss-in-tensorboard">Logging training and validation loss in tensorboard</a>.</p>
  
  <p>To make things easier to handle, I would like to merge my summaries into two merged summaries, one for training and one for validation.(I will add more stuff eventually, like images weights etc.) I tried to follow the description from tensorboard <a href="https://www.tensorflow.org/api_docs/python/tf/summary/merge" rel="noreferrer">tf.summary.merge</a>. I can't make it work and I am unable to find any working examples to help me understand where I am going wrong. </p>
  
  <pre><code>with tf.name_scope('accuracy'):
      correct_prediction = tf.equal(tf.argmax(y_logits, 1), tf.argmax(y, 1))
      accuracy = tf.reduce_mean(tf.cast(correct_prediction, 'float'))
      tf.summary.scalar('accuracy', accuracy)
      tf.summary.scalar('train_accuracy', accuracy)
  
  with tf.name_scope('Cost'):
      cross_entropy = tf.reduce_mean(
          tf.nn.softmax_cross_entropy_with_logits(logits=y_logits, labels=y))
      opt = tf.train.AdamOptimizer()
      optimizer = opt.minimize(cross_entropy)
      grads = opt.compute_gradients(cross_entropy, [b_fc_loc2])
      tf.summary.scalar('cost', cross_entropy)
      tf.summary.scalar('train_cost', cross_entropy)
  
  
  with tf.Session() as sess:
      writer = tf.summary.FileWriter('./logs/mnistlogs/1f', sess.graph)
      sess.run(tf.global_variables_initializer())
      merged = tf.summary.merge([cost, accuracy])
  </code></pre>
  
  <p>This results in the following error:</p>
  
  <blockquote>
    <p>InvalidArgumentError (see above for traceback): Could not parse one of the summary inputs
             [[Node: Merge/MergeSummary = MergeSummary[N=2, _device="/job:localhost/replica:0/task:0/cpu:0"](Merge/MergeSummary/inputs_0, Merge/MergeSummary/inputs_1)]]</p>
  </blockquote>
  
  <p>I would like to know why this doesn't work, and how I can find a solution, any working examples are appreciated.</p>