模块'tensorflow.contrib.lite.python.lite版“”没有属性“TFLiteConverter”

2024-03-29 08:06:17 发布

您现在位置:Python中文网/ 问答频道 /正文

使用googlecolab,我试图将keras神经网络文件转换成tensorflow lite。在

pip install --upgrade "tensorflow==1.7.*"

import tensorflow
from tensorflow.contrib import lite
#from  tensorflow.contrib.lite.python import convert_saved_model
converter = lite.TFLiteConverter.from_keras_model_file( 'weights-origin.hdf5')
tfmodel = converter.convert()

open ("model.tflite" , "wb") .write(tfmodel)

我得到这样的信息:

^{pr2}$

来自TensorFlow AttributeError: module tensorflow.contrib.lite.python.lite has no attribute TFLiteConverter的答案 帮不了我。在


Tags: pip文件fromimportconvertmodeltensorflow神经网络