Plot training and validation losses of object detection model 
@HripsimeS,
Could you please try to check the below sample workaround where we can plot training and the validation loss. Also Kindly find the [gist](https://colab.research.google.com/gist/tilakrayal/fd6ccd5a44fa5142b5e2854780fc2272/tflite-training-sinewave.ipynb) for the reference.
```
# Draw a graph of the loss, which is the distance between
# the predicted and actual values during training and validation.
loss = training_info.history['loss']
validation_loss = training_info.history['val_loss']

epochs = range(1, len(loss) + 1)

plt.plot(epochs, loss, 'g.', label='Training loss')
plt.plot(epochs, validation_loss, 'b', label='Validation loss')
plt.title('Training and validation loss')
plt.xlabel('Epochs')
plt.ylabel('Loss')
plt.legend()
plt.show()
```
Thank you! @tilakrayal thank you very much for your reply. The notebook you shared they created the model **model = model.fit(...)**

In my case I use the following notebook https://www.tensorflow.org/lite/models/modify/model_maker/object_detection
And they create the model with **model = object_detector.create(....)**

That's why when I use the history to get the information about losses, it gives me this error 
**AttributeError: 'ObjectDetector' object has no attribute 'history'**

My question is how to get information about losses if you using **object_detector.create** to train the mobile models? Hi @HripsimeS 

The object detector class returns Keras model which has callbacks history enabled. You can obtain the  information about  losses by calling the history function on the model returned by the object detector's Keras model. Please try the following snippet to get the train loss vs val loss trained using object detector.

```
history = model.model.history
loss = history.history['loss']
val_loss = history.history['val_loss']
plt.plot(loss, label='Training Loss')
plt.plot(val_loss, label='Validation Loss')
plt.legend(loc='upper right')
plt.ylabel('Cross Entropy')
plt.title('Training and Validation Loss')
plt.xlabel('epoch')
plt.show() 
```
 Please find the gist [here](https://colab.research.google.com/gist/pjpratik/297650bb92325965a45431bf01827fec/model-maker-object-detection-tutorial.ipynb#scrollTo=6JfXtC4UTiTP) in which the train loss and val loss are plotted using object detection example.

Thanks. @pjpratik thank you very much, it was very useful 🥇  So the only part was missing was **model.model.history** :)  Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60087">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60087">No</a>

Hello. I am using the following notebook to train my dataset with **efficientdet-lite0** model. 
https://www.tensorflow.org/lite/models/modify/model_maker/object_detection

I can see for each epoch we get the information of training loss "loss" and validation loss "val_loss". I would like to plot them like:

loss = model.history['loss']
val_loss = model.history['val_loss']
plt.plot(loss, label='Training Loss')
plt.plot(val_loss, label='Validation Loss')
plt.legend(loc='upper right')
plt.ylabel('Cross Entropy')
plt.ylim([0,1.0])
plt.title('Training and Validation Loss')
plt.xlabel('epoch')
plt.show()

And unfortunately getting the following error **AttributeError: 'ObjectDetector' object has no attribute 'history'** 
Can you help me to figure out how to plot training and validation losses on the same graph. Thanks in advance!