无法将 h5 模型转换为 tflite

时间:2021-05-19 15:59:53

标签: tensorflow keras image-segmentation

我下载了在网上找到的 h5 模型,将其加载到我的谷歌驱动器中,然后尝试将其转换为 tflite。 我的代码在这里(google colab):

import tensorflow as tf

model = tf.keras.models.load_model("/content/drive/MyDrive/model.h5")  #here i get the error

converter = tf.lite.TFLiteConverter.from_keras_model(model)
tflite_model = converter.convert()

# Save the model.
with open('model.tflite', 'wb') as f:
  f.write(tflite_model)

但我收到错误“在配置文件中找不到模型”。 我做错了什么?

0 个答案:

没有答案