title: How to fix 'RuntimeError: `get_session` is not available when using TensorFlow 2.0.'
body: <p>I am new to python and I have be trying to run this code. But I keep getting this error.</p>
  
  <pre><code>from imageai.Detection import ObjectDetection
  import os
  
  execution_path = os.getcwd()
  
  detector = ObjectDetection()
  detector.setModelTypeAsRetinaNet()
  detector.setModelPath( os.path.join(execution_path , "resnet50_coco_best_v2.0.1.h5"))
  detector.loadModel()
  self.sess = tf.compat.v1.keras.backend.get_session()
  detections = detector.detectObjectsFromImage(input_image=os.path.join(execution_path , "image.jpg"), output_image_path=os.path.join(execution_path , "imagenew.jpg"))
  
  for eachObject in detections:
      print(eachObject["name"] , " : " , eachObject["percentage_probability"] )
  </code></pre>
  
  <p>I am supposed to get the percentage for the objects in the image but instead I am getting this:</p>
  
  <blockquote>
    <p>Using TensorFlow backend. Traceback (most recent call last):   File
    "detector.py", line 6, in 
        detector = ObjectDetection()   File "C:\Python36\lib\site-packages\imageai\Detection__init__.py", line
    88, in <strong>init</strong>
        self.sess = K.get_session()   File "C:\Python36\lib\site-packages\keras\backend\tensorflow_backend.py",
    line 379, in get_session
        '<code>get_session</code> is not available ' RuntimeError: <code>get_session</code> is not available when using TensorFlow 2.0.</p>
  </blockquote>