title: Keras: UnboundLocalError: local variable 'logs' referenced before assignment
body: <p>I am relatively new to python, and while attempting to train a chatbot I received the error: ‘UnboundLocalError: local variable 'logs' referenced before assignment‘. I used model.fit to train:</p>
  
  <pre><code>model.fit(x_train, y_train, epochs=7)
  </code></pre>
  
  <p>And I received the error:</p>
  
  <pre><code>UnboundLocalError                         Traceback (most recent call last)
  &lt;ipython-input-10-847c83704a3f&gt; in &lt;module&gt;()
        2           x_train,
        3           y_train,
  ----&gt; 4           epochs=7
        5           )
  
  1 frames
  /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py in _method_wrapper(self, *args, **kwargs)
       64   def _method_wrapper(self, *args, **kwargs):
       65     if not self._in_multi_worker_mode():  # pylint: disable=protected-access
  ---&gt; 66       return method(self, *args, **kwargs)
       67 
       68     # Running inside `run_distribute_coordinator` already.
  
  /usr/local/lib/python3.6/dist-packages/tensorflow/python/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_batch_size, validation_freq, max_queue_size, workers, use_multiprocessing)
      854               logs = tmp_logs  # No error, now safe to assign to logs.
      855               callbacks.on_train_batch_end(step, logs)
  --&gt; 856         epoch_logs = copy.copy(logs)
      857 
      858         # Run validation.
  
  UnboundLocalError: local variable 'logs' referenced before assignment 
  
  </code></pre>
  
  <p>I ran this in google colab, with the link here: <a href="https://colab.research.google.com/drive/18uTvvKYDrd8CQi31kg6vX2Dbxg1gD20X?usp=sharing" rel="noreferrer">https://colab.research.google.com/drive/18uTvvKYDrd8CQi31kg6vX2Dbxg1gD20X?usp=sharing</a></p>
  
  <p>I used the chatterbot/english dataset on kaggle: <a href="https://www.kaggle.com/kausr25/chatterbotenglish" rel="noreferrer">https://www.kaggle.com/kausr25/chatterbotenglish</a> </p>