We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1902795 commit 4c27b29Copy full SHA for 4c27b29
src/convert.py
@@ -0,0 +1,12 @@
1
+import tensorflow as tf
2
+
3
+model_path = "../models/yingyan_model.h5"
4
+model = tf.keras.models.load_model(model_path)
5
6
+converter = tf.lite.TFLiteConverter.from_keras_model(model)
7
+tflite_model = converter.convert()
8
9
+# 保存为 .tflite 文件
10
+tflite_model_path = "../models/yingyan_model.tflite"
11
+with open(tflite_model_path, "wb") as f:
12
+ f.write(tflite_model)
0 commit comments