I added the following code to the end of the train.py file and got the tflite file, but when I used this tflite file, I found that there was a problem, please tell me what to do?
Code:
saved_model_dir = './log/model_save'
tf.saved_model.save(model, saved_model_dir)
converter = tf.lite.TFLiteConverter.from_saved_model(saved_model_dir)
tflite_model = converter.convert()
with open('checkpoints/model_save_8211/detect.tflite', 'wb') as f:
f.write(tflite_model)
I added the following code to the end of the train.py file and got the tflite file, but when I used this tflite file, I found that there was a problem, please tell me what to do?
Code: saved_model_dir = './log/model_save' tf.saved_model.save(model, saved_model_dir) converter = tf.lite.TFLiteConverter.from_saved_model(saved_model_dir) tflite_model = converter.convert() with open('checkpoints/model_save_8211/detect.tflite', 'wb') as f: f.write(tflite_model)