【发布时间】:2020-06-27 13:02:47
【问题描述】:
为了在新的 OpenMV Cam H7 plus 上运行,我将我的 keras .h5 文件转换为量化的 tflite,但是当我运行它时,我收到一条错误消息,提示“TFLite Micro 不支持混合模型。”
我不确定为什么我的模型显示为混合模型;我用来转换的代码如下:
model = load_model('inceptionV3.h5')
# Convert the model.
converter = tf.lite.TFLiteConverter.from_keras_model(model)
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.target_ops = [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]
tflite_model = converter.convert()
# Save the TF Lite model.
with tf.io.gfile.GFile('inceptionV3_openmv2.tflite', 'wb') as f:
f.write(tflite_model)
如果我做错了什么或有更好的方法来转换它,如果有人能指导我,我将不胜感激。
【问题讨论】:
标签: tensorflow tensorflow2.0 tensorflow-lite