title: Keras : history not accessible for loss or accuracy
body: <p>
  I am training a CNN in Keras with Tensorflow backend, </p>
  
  
  
  <pre class="lang-python prettyprint-override"><code>mod1=gmodel.fit(images, train_labels,
        batch_size=100,
        epochs=2,
        verbose=1,
        validation_data=(test_images, test_labels))
  </code></pre>
  
  <p>and at every epoch I can see printed in the output the accuracy and loss (until here everything seems ok).</p>
  
  <pre class="lang-python prettyprint-override"><code>Epoch 1/10
  1203/1203 [==============================] - 190s - loss: 0.7600 - acc: 0.5628 
  - val_loss: 0.5592 - val_acc: 0.6933
  Epoch 2/10
  1203/1203 [==============================] - 187s - loss: 0.5490 - acc: 0.6933 
  - val_loss: 0.4589 - val_acc: 0.7930
  Epoch 3/10
  ....
  </code></pre>
  
  <p>At the end, I want to plot the validation loss so in previous projects I have accessed the validation loss via</p>
  
  <pre class="lang-python prettyprint-override"><code>mod1.history['val_loss']
  </code></pre>
  
  <p>but I am getting an error as if <code>.history()</code> was empty.</p>
  
  <pre class="lang-python prettyprint-override"><code>TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-23-ecdd306e9232&gt; in &lt;module&gt;()
  ----&gt; 1 modl.history()
  TypeError: 'History' object is not callable
  </code></pre>
  
  <p>EDIT (after answer below): When I try to access the loss, for example:</p>
  
  <pre class="lang-python prettyprint-override"><code>---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-34-06fcc6efb374&gt; in &lt;module&gt;()
  ----&gt; 1 mod1.history['val_loss']
  
  TypeError: 'History' object is not subscriptable
  </code></pre>
  
  <p>I haven't found anything like this problem before, so I am lost as to what could be happening or how to debug.</p>
  
  <p>Any pointers or ideas are greatly appreciated.</p>