'Tensorflow Lite model maker: training chart possible?

i am using the Tensorflow Lite Model Maker library to train an efficient model for object detection. It works well, but I don’t know how to get graphs of the training process. It prints just the loss values per epoch on the console. Is it possible to get a chart with for example accuracy, recall, precision, f1,…(for every epoch) while or after training? Such a chart would be great for my master’s thesis. Thank you so much.

Greetings,

Daniel Hauser



Solution 1:[1]

when you do model.train(...) the function return history json object

history = model.train(...)

you can list all data in history

print(history.history.keys())

To plot the history accuracy:

plt.plot(history.history['accuracy'])
plt.plot(history.history['val_accuracy'])
plt.title('model accuracy')
plt.ylabel('accuracy')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper left')
plt.show()

accuracy

history for loss

plt.plot(history.history['loss'])
plt.plot(history.history['val_loss'])
plt.title('model loss')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper left')
plt.show()

loss

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Zouinkhi