Is there a way to visualize the loss and accuracy of media pipe's image classifier?

0

I have trained a model using the media pipe model = image_classifier.ImageClassifier.create(..). In order to plot and see the loss val_loss and accuracy and val_accuracy we need a history attribute. But there is no history attribute. In other lib like TensorFlow and TensorFlow model maker, they have a model. history attribute from where we can plot the graph easily.

Is there any way to plot the graph in the media pipe. Please guide me in this matter.

model = image_classifier.ImageClassifier.create(
train_data = train_data,
validation_data = validation_data,
options=options,
)


import matplotlib.pyplot as plt
%matplotlib inline

history_dict = model.history.history

LOSS:

loss_values = history_dict[‘loss’]
epochs = range(1, len(loss_values) + 1)
line1 = plt.plot(epochs, loss_values, label=‘Training Loss’)
plt.setp(line1, linewidth=2.0, marker = ‘+’, markersize=10.0)
plt.xlabel(‘Epochs’)
plt.ylabel(‘Loss’)
plt.grid(True)
plt.legend()
plt.show()

ACCURACY:

acc_values = history_dict[‘accuracy’]
epochs = range(1, len(loss_values) + 1)
line1 = plt.plot(epochs, acc_values, label=‘Training Accuracy’)
plt.setp(line1, linewidth=2.0, marker = ‘+’, markersize=10.0)
plt.xlabel(‘Epochs’)
plt.ylabel(‘Accuracy’)
plt.grid(True)
plt.legend()
plt.show()


Error is Here:

AttributeError Traceback (most recent call last)
in <cell line: 4>()
2 get_ipython().run_line_magic(‘matplotlib’, ‘inline’)
3
----> 4 history_dict = model.history.history
5
6 ### LOSS:

AttributeError: ‘ImageClassifier’ object has no attribute ‘history’

I have seen the documentation and they says

An instance based on ImageClassifier.

[API Docs To Media Pipe][(mediapipe_model_maker.image_classifier.ImageClassifier  |  MediaPipe  |  Google for Developers)](https://Media Pipe Docs)

Any media pipe team member who can guide ?