title: Problem when using cx_Freeze: "cannot import name 'tf2'"
body: <p>I have a code in python and I used cx_Freeze to convert it to an .exe. This task works without any error.
  But when I try to run my .exe the following error happens:</p>
  
  <blockquote>
    <p>from tensorflow.python import tf2<br>
    ImportError: cannot import name 'tf2'</p>
  </blockquote>
  
  <p>My <code>ann.py</code> code is:</p>
  
  <pre><code>import numpy as np
  import sys
  </code></pre>
  
  <p>.
  .
  .    </p>
  
  <pre><code>X_test=XinN
  Y_test=XoutN
  
  
  #Criando o modelo
  from keras.models import Sequential
  from keras.layers import Dense
  
  modelo = Sequential()
  
  for i in range(int((num_par-4)/2)):
     modelo.add(Dense(int(parametros[i+4]), kernel_initializer='normal',activation=ativacao(int(parametros[i+5])))) #camadas ocultas
  modelo.add(Dense(num_out, kernel_initializer='normal',activation=ativacao(int(parametros[num_par-1])))) #camada de saída
  
  modelo.compile(optimizer='adam',loss='mean_squared_error')
  
  hist = modelo.fit(X_train, Y_train, epochs=800, verbose=0, batch_size=10,validation_data=(X_test, Y_test))
  
  XobsoutN=modelo.predict(XobsN)
  Xobsout=XobsoutN*(max_out-min_out)+min_out
  np.savetxt("Xobsout.txt",Xobsout.transpose(),delimiter='\t')
  
  loss=[" "," "]
  loss[0] = hist.history['loss']
  loss[1] = hist.history['val_loss']
  
  np.savetxt("erro.txt",loss,delimiter='\t')
  </code></pre>
  
  <p>And my <code>setyp.py</code> for cx_Freeze is:</p>
  
  <pre><code>from cx_Freeze import setup, Executable
  import sys
  
  base = None
  
  if sys.platform == 'win32':
      base = None
  
  
  executables = [Executable("ANN.py", base=base)]
  
  packages = ["idna"]
  
  options = {
      'build_exe': {
          'includes':['atexit', 'numpy.core._methods', 'numpy.lib.format'],
          'packages':packages,
      },
  
  }
  
  import os
  
  os.environ['TCL_LIBRARY'] = "C:\\ProgramData\\Anaconda3\\tcl\\tcl8.6"
  os.environ['TK_LIBRARY'] = "C:\\ProgramData\\Anaconda3\\tcl\\tk8.6"
  
  setup(
      name = "Nome Executavel",
      options = options,
      version = "1.0",
      description = 'Descricao do seu arquivo',
      executables = executables
  )
  </code></pre>
  
  <p>Anyone can help me to solve this error?</p>
  
  <p>I had many others errors using cx_Freeze and this forum was pretty helpful to solve all of them. Thanks a lot!</p>