title: TypeError("Tensor is unhashable if Tensor equality is enabled. " K.learning_phase(): 0
body: <p>I am porting a Keras, Tensorflow, and OpenCV script to TF2 and Keras 2 and have run into a problem. I am getting an error on K.learning_phase(): 0. 
  The error happens in this code section.</p>
  
  <pre><code>ef detect_image(self, image):
          if self.model_image_size != (None, None):
              assert self.model_image_size[0]%32 == 0, 'Multiples of 32 required'
              assert self.model_image_size[1]%32 == 0, 'Multiples of 32 required'
              boxed_image = image_preporcess(np.copy(image), tuple(reversed(self.model_image_size)))
              image_data = boxed_image
  
          out_boxes, out_scores, out_classes = self.sess.run(
              [self.boxes, self.scores, self.classes],
              feed_dict={
                  self.yolo_model.input: image_data,
                  self.input_image_shape: [image.shape[0], image.shape[1]],
                  tf.keras.learning_phase(): 0  })
  
  </code></pre>
  
  <p>here is a gist to the full code
  <a href="https://gist.github.com/robisen1/31976de17af9e752c6ba8d1dd0e08906" rel="nofollow noreferrer">https://gist.github.com/robisen1/31976de17af9e752c6ba8d1dd0e08906</a></p>
  
  <pre><code>Traceback (most recent call last):
    File "webcam_detect.py", line 188, in &lt;module&gt;
      r_image, ObjectsList = yolo.detect_image(frame)
    File "webcam_detect.py", line 110, in detect_image
      K.learning_phase(): 0
    File "C:\Anaconda3\envs\simplecv\lib\site-packages\tensorflow_core\python\framework\ops.py", line 705, in __hash__
      raise TypeError("Tensor is unhashable if Tensor equality is enabled. "
  TypeError: Tensor is unhashable if Tensor equality is enabled. Instead, use tensor.experimental_ref() as the key.
  (simplecv) PS C:\dev\lacv\yolov3\yolov3ct&gt; 
  </code></pre>
  
  <p>I am not sure what is going on. I would appreciate any insights.</p>