title: What is the difference between "from keras.models import Sequential" and "from tensorflow.python.keras.models import Sequential"?
body: <p>I'm using Tensorflow 1.14 and Python 3.5. 
  I got the following error: </p>
  
  <p><code>UnboundLocalError: local variable 'batch_index' referenced before assignment</code> </p>
  
  <p>The full trace back is:</p>
  
  <pre><code>---------------------------------------------------------------------------
  UnboundLocalError                         Traceback (most recent call last)
  &lt;timed exec&gt; in &lt;module&gt;
  
  /usr/local/lib/python3.5/dist-packages/keras/engine/training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, validation_freq, max_queue_size, workers, use_multiprocessing, **kwargs)
     1237                                         steps_per_epoch=steps_per_epoch,
     1238                                         validation_steps=validation_steps,
  -&gt; 1239                                         validation_freq=validation_freq)
     1240 
     1241     def evaluate(self,
  
  /usr/local/lib/python3.5/dist-packages/keras/engine/training_arrays.py in fit_loop(model, fit_function, fit_inputs, out_labels, batch_size, epochs, verbose, callbacks, val_function, val_inputs, shuffle, initial_epoch, steps_per_epoch, validation_steps, validation_freq)
      203                     break
      204 
  --&gt; 205             if batch_index == len(batches) - 1:  # Last batch.
      206                 if do_validation and should_run_validation(validation_freq, epoch):
      207                     val_outs = test_loop(model, val_function, val_inputs,
  
  UnboundLocalError: local variable 'batch_index' referenced before assignment
  </code></pre>
  
  <p>And after trying multiple suggestions from different SO answers, I managed to fix it by switching from these import statements: </p>
  
  <pre><code>from keras.layers import LSTM, Dense
  from keras.models import Sequential
  </code></pre>
  
  <p>To these import statements: </p>
  
  <pre><code>from tensorflow.python.keras.layers import LSTM, Dense
  from tensorflow.python.keras.models import Sequential
  </code></pre>
  
  <p>This did resolve my issue, but I am puzzled: How are the two any different? </p>
  
  <p>Are <code>tf.keras</code> and <code>keras</code> using different methods and classes?</p>