title: How to save a dictionary of variables in TensorFlow using the Saver object?
body: <p>I've built a simple 4 layer Neural Network (2 hidden layers) in TensorFlow. I am not using the built in NN provided by TensorFlow but implementing a basic version of my own. Now, to keep W (weights) and B(biases) Tensor's at one place I built a dictionary of these variables like this:</p>
  
  <pre><code>weights = {
      'h1': tf.Variable(tf.random_normal([n_input, n_hidden_1])),
      'h2': tf.Variable(tf.random_normal([n_hidden_1, n_hidden_2])),
      'out': tf.Variable(tf.random_normal([n_hidden_2, n_classes]))
  }
  biases = {
      'b1': tf.Variable(tf.random_normal([n_hidden_1])),
      'b2': tf.Variable(tf.random_normal([n_hidden_2])),
      'out': tf.Variable(tf.random_normal([n_classes]))
  }
  </code></pre>
  
  <p>After I learn these parameters, I want to save them using the Saver object. I tried this: </p>
  
  <pre><code>saver = tf.train.Saver([weights,biases])
  save_path = saver.save(sess,"./data/model.ckpt")
  </code></pre>
  
  <p>But I'm unsuccessful in doing so. The error seen is:</p>
  
  <pre><code>TypeError: unhashable type: 'dict'
  </code></pre>
  
  <p>Now, one solution is to separate all the variables : h1,h2,out,b1,b2,bias_out (out of biases dictionary) into individual variables and save them but this seems a naive approach. If I later have more variables that need to be clubbed together  I'd like to keep it that way, it's more clean and manageable. How can I save the grouped variables together ?</p>