how to visualize/plot the process of training model by using tfliite-model-maker "image_classifier.create()"?

Viewed 140

Excuse me. It's my first time, please give me support. I am very new to machine learning and tensorflow.

I was trying to build a model.tflite with PIP tflite-model-maker. Then, i'm using "image_classifier.create()" for train my model. Can anyone help me to visualize the training process? as long as my search, I cant apply history = model.fit() to solve this problem.

Here is the code for training

import datetime
import tflite_model_maker
start = datetime.datetime.now()

model = tflite_model_maker.image_classifier.create(
    train_data,
    model_spec='efficientnet_lite0',
    #model_spec='efficientnet_lite1',
    #model_spec='efficientnet_lite2',
    #model_spec='efficientnet_lite3',
    #model_spec='efficientnet_lite4',
    #model_spec='mobilenet_v2',
    #model_spec='resnet_50',
    use_augmentation=True,
    validation_data=validation_data,
    epochs=30,
    dropout_rate=0.3,
    learning_rate=0.0001,
    shuffle=True
)

end= datetime.datetime.now()
elapsed= end-start
print ('Time: ', elapsed)

Here is the error

model = model_spec.get('efficientnet_lite0')
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
history = model.fit(x_train, y_train, epoch=30, validation_data=(x_test, y_test), shuffle=True)

AttributeError: 'ImageModelSpec' object has no attribute 'get'

0 Answers
Related