如何绘制图表以查看准确性

How to plot a graph to see the accuracy

我正在使用 tflite_model_maker

from tflite_model_maker import model_spec
from tflite_model_maker import image_classifier
from tflite_model_maker.config import ExportFormat
from tflite_model_maker.config import QuantizationConfig
from tflite_model_maker.image_classifier import DataLoader

我想训练模型并想绘制图表以查看模型的性能,但是这个模型没有 history

model = image_classifier.create(train_data,
                                model_spec = model_spec.get('efficientnet_lite4'),
                                validation_data=validation_data,
                                batch_size = 32,
                                epochs=200,
                                train_whole_model = True,
                                dropout_rate=0.25,
                                learning_rate = 0.01,
                                momentum = 0.9,
                                shuffle=True,
                                ) 

我该怎么办?

这与您习惯的略有不同,但您可以按如下方式访问所需的指标:

model.history.history['loss']
model.history.history['accuracy']
model.history.history['val_loss']
model.history.history['val_accuracy']