title: Tensorflow==2.0.0a0 - AttributeError: module 'tensorflow' has no attribute 'global_variables_initializer'
body: <p>I'm using <code>Tensorflow==2.0.0a0</code> and want to run the following script:</p>
  
  <pre><code>import tensorflow as tf
  import tensorboard
  import pandas as pd
  import matplotlib.pyplot as plt
  import numpy as np
  import tensorflow_probability as tfp
  from tensorflow_model_optimization.sparsity import keras as sparsity
  from tensorflow import keras
  
  tfd = tfp.distributions
  
  init = tf.global_variables_initializer()
  
  with tf.Session() as sess:
      sess.run(init)
  
      model = tf.keras.Sequential([
        tf.keras.layers.Dense(1,kernel_initializer='glorot_uniform'),
        tfp.layers.DistributionLambda(lambda t: tfd.Normal(loc=t, scale=1))
      ])
  </code></pre>
  
  <p>All my older notebooks work with TF 1.13. However, I want to develop a notebook where I use Model Optimization (Neural net pruning) + TF Probability, which require <code>Tensorflow &gt; 1.13</code>.</p>
  
  <p>All libraries are imported but <code>init = tf.global_variables_initializer()</code> generates the error:</p>
  
  <pre><code>AttributeError: module 'tensorflow' has no attribute 'global_variables_initializer'
  </code></pre>
  
  <p>Also, <code>tf.Session()</code> generates the error:</p>
  
  <pre><code>AttributeError: module 'tensorflow' has no attribute 'Session'
  </code></pre>
  
  <p>So I guess it may be something related to <strong>Tensorflow</strong> itself, but I don't have older versions confliciting in my Anaconda environment.</p>
  
  <p>Outputs for libraries' versions:</p>
  
  <pre><code>tf.__version__
  Out[16]: '2.0.0-alpha0'
  
  tfp.__version__
  Out[17]: '0.7.0-dev20190517'
  
  keras.__version__
  Out[18]: '2.2.4-tf'
  </code></pre>
  
  <p>Any ideas on this issue ?</p>