import tensorflow as tf
import pathlib
print(tf.__version__)
modelDir = 'model/1/'
converter = tf.lite.TFLiteConverter.from_saved_model(modelDir)
converter.optimizations = [tf.lite.Optimize.OPTIMIZE_FOR_SIZE]
tflite_model = converter.convert()
tflite_model_file = pathlib.Path('model/model.tflite')
tflite_model_file.write_bytes(tflite_model)
Traceback (most recent call last):
File "D:/newTf/tfLite.py", line 22, in <module>
tflite_model = converter.convert()
File "C:\Users\86182\Anaconda3\envs\newtf\lib\site-packages\tensorflow\lite\python\lite.py", line 392, in convert
**converter_kwargs)
File "C:\Users\86182\Anaconda3\envs\newtf\lib\site-packages\tensorflow\lite\python\convert.py", line 404, in toco_convert_impl
input_data.SerializeToString())
File "C:\Users\86182\Anaconda3\envs\newtf\lib\site-packages\tensorflow\lite\python\convert.py", line 172, in toco_convert_protos
"TOCO failed. See console for info.\n%s\n%s\n" % (stdout, stderr))
tensorflow.lite.python.convert.ConverterError: TOCO failed. See console for info.
b"'toco_from_protos' \xb2\xbb\xca\xc7\xc4\xda\xb2\xbf\xbb\xf2\xcd\xe2\xb2\xbf\xc3\xfc\xc1\xee\xa3\xac\xd2\xb2\xb2\xbb\xca\xc7\xbf\xc9\xd4\xcb\xd0\xd0\xb5\xc4\xb3\xcc\xd0\xf2\r\n\xbb\xf2\xc5\xfa\xb4\xa6\xc0\xed\xce\xc4\xbc\xfe\xa1\xa3\r\n"
使用saved_model在轉換為tensorflow.lite程序中,converter.convert()一直報錯,我是用tensorflow版本2.0.0,1.14.0,1.15.0都試過了,一直出現下面同一個錯誤,不知道有沒有前輩遇到過,幫忙解答一下,感激不盡。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/68363.html
標籤:機器視覺
上一篇:SVM+HOG做樣本訓練時報錯,改了路徑也還是不行,求助,謝謝
下一篇:我喜歡的人叫楊
