【发布时间】:2021-02-13 21:26:16
【问题描述】:
我尝试了很多方法,但无法将保存的模型文件转换为 tf lite 模型,每次运行新代码时都会出现不同的错误。从形状错误到下面列出的错误。
File "C:\\models\py\lib\site-packages\tensorflow\python\eager\monitoring.py", line 407, in __del__
AttributeError: 'NoneType' object has no attribute 'TFE_MonitoringDeleteBuckets'
我正在使用此代码:
import tensorflow as tf
#Convert the model
converter = tf.lite.TFLiteConverter.from_saved_model('new_graph/saved_model') # path to the SavedModel directory
tflite_model = converter.convert()
#Save the model.
with open('facemask_model.tflite', 'wb') as f:
tf.write(tflite_model)
谁能告诉我如何转换成 tf lite 模型,我在这里卡了几天
【问题讨论】:
标签: python tensorflow keras model google-colaboratory