![](/img/trans.png)
[英]Getting Error while converting tensorflow model to tensorflow lite = ValueError: bad marshal data (unknown type code)
[英]Error while converting tensorflow model to tensorflow lite (.h5 to .tflite) = ValueError: bad marshal data (unknown type code)
I am using a pre-trained keras based and tensorflow based model with yolov2 architecture for potholes detection and I'm getting an error while converting my tensorflow model to tensorflow lite
from tensorflow.contrib import lite
converter = lite.TFLiteConverter.from_keras_model_file( 'model.h5' )
model = converter.convert()
file = open( 'model.tflite' , 'wb' )
file.write( model )
我建议走一条更长但经过测试的道路。
1) 将您的 model 直接转换为.pb
冻结图形格式或使用如何将 Keras.h5 导出为 tensorflow.p从h5
转换为.pb
?
2)按照我在这里的描述将.pb
转换为tflite
: https://medium.com/@prashantdandriyal7/darknet-to-tensorflow-to-tensorflowlite-b783d55b106a
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.