Python 3.x 将花卉分类保存为tensorflow lite文件并导入

Python 3.x 将花卉分类保存为tensorflow lite文件并导入,python-3.x,tensorflow,keras,tensorflow-lite,image-classification,Python 3.x,Tensorflow,Keras,Tensorflow Lite,Image Classification,我从中创建了模型,并使其正常工作。我使用以下命令将模型保存为tensorflow lite文件: converter = tf.lite.TFLiteConverter.from_keras_model(model) tflite_model = converter.convert() filepath = os.path.join('path', 'model.tflite') with open('model.tflite', 'wb') as f: f.write(tflite_m

我从中创建了模型,并使其正常工作。我使用以下命令将模型保存为tensorflow lite文件:

converter = tf.lite.TFLiteConverter.from_keras_model(model)
tflite_model = converter.convert()
filepath = os.path.join('path', 'model.tflite')


with open('model.tflite', 'wb') as f:
  f.write(tflite_model)
然后我将它导入到另一个python代码中,但是在多次尝试之后,我无法让这个tensorflow lite文件做出相同的预测。如何使这个分类示例的tensorflow lite文件版本也能起到同样的作用?

对您有帮助吗?