title: {TypeError}unhashable type: 'numpy.ndarray'
body: <p>I use tensorflow to build a model and want to train it, but I get this error:</p>
  
  <blockquote>
    <p>{TypeError}unhashable type: <code>'numpy.ndarray'</code></p>
  </blockquote>
  
  <p>one part of my code as follows:</p>
  
  <pre><code>with tf.Session() as sess:
      init = tf.global_variables_initializer()
      sess.run(init)
      for epoch in range(a.epochs):
          input, target = load_batch_data(batch_size=16, a=a)
          batch_input = input.astype(np.float32)
          batch_target = target.astype(np.float32)
          sess.run(predict_real, feed_dict={input: batch_input, target: batch_target})
  </code></pre>
  
  <p><code>'predict_real'</code> is the output of my model, I just try to run it, but error!</p>
  
  <p>here is the code of my model:</p>
  
  <pre><code>def build_model(input, target):
      with tf.variable_scope("generator"):
        out_channels = int(target.get_shape()[-1])
        outputs = create_generator(input, out_channels)
  
  
      with tf.name_scope("real_discriminator"):
          with tf.variable_scope("discriminator"):
             predict_real = create_discriminator(input, target)
  
      with tf.name_scope("fake_discriminator"):
           with tf.variable_scope("discriminator", reuse=True):
             predict_fake = create_discriminator(input, outputs)
  
      with tf.name_scope("discriminator_loss"):
           discrim_loss = tf.reduce_mean(-(tf.log(predict_real + EPS) + tf.log(1 - predict_fake + EPS)))
  
      with tf.name_scope("generator_loss"):
         gen_loss_GAN = tf.reduce_mean(-tf.log(predict_fake + EPS))
         gen_loss_L1 = tf.reduce_mean(tf.abs(target - outputs))
         gen_loss = gen_loss_GAN * a.gan_weight + gen_loss_L1 * a.l1_weight
  
      with tf.name_scope("discriminator_train"):
         discrim_tvars = [var for var in tf.trainable_variables() if var.name.startswith("discriminator")]
         discrim_optim = tf.train.AdamOptimizer(a.lr, a.beta1)
         discrim_grads_and_vars = discrim_optim.compute_gradients(discrim_loss, var_list=discrim_tvars)
         discrim_train = discrim_optim.apply_gradients(discrim_grads_and_vars)
  
      with tf.name_scope("generator_train"):
          with tf.control_dependencies([discrim_train]):
              gen_tvars = [var for var in tf.trainable_variables() if var.name.startswith("generator")]
              gen_optim = tf.train.AdamOptimizer(a.lr, a.beta1)
              gen_grads_and_vars = gen_optim.compute_gradients(gen_loss, var_list=gen_tvars)
              gen_train = gen_optim.apply_gradients(gen_grads_and_vars)
  
      ema = tf.train.ExponentialMovingAverage(decay=0.99)
      update_losses = ema.apply([discrim_loss, gen_loss_GAN, gen_loss_L1])
  
      global_step = tf.train.get_or_create_global_step()
      incr_global_step = tf.assign(global_step, global_step+1)
      return Model(
        predict_real=predict_real,
        predict_fake=predict_fake,
        discrim_loss=ema.average(discrim_loss),
        discrim_grads_and_vars=discrim_grads_and_vars,
        gen_loss_GAN=ema.average(gen_loss_GAN),
        gen_loss_L1=ema.average(gen_loss_L1),
        gen_grads_and_vars=gen_grads_and_vars,
        outputs=outputs,
        train=tf.group(update_losses, incr_global_step, gen_train),
  )
  </code></pre>