subaochen / subaochen.github.io

MIT License
1 stars 3 forks source link

使用tensorflow lite遇到的一些坑 #42

Open subaochen opened 5 years ago

subaochen commented 5 years ago

https://subaochen.github.io/android/2019/08/12/tensorflow-lite-note/

dongtaishanybc commented 2 years ago

您好,在使用tflite中遇到一些问题可以帮忙解答一下吗 我在使用tfllite中采用的配置如下: converter.optimizations = [tf.lite.Optimize.DEFAULT] converter.representative_dataset = representative_dataset_gen tflite_model = converter.convert() open(output_model_filepath, "wb").write(tflite_model) 保存路径假设为xx.tflite 但在load_tflite时: interpreter = tf.lite.Interpreter(model_path=“xx.tflite”) 报错: _interpreter_wrapper.CreateWrapperFromFile( ValueError: Could not open (xx.tflite”)

如果配置是: converter.optimizations = [tf.lite.Optimize.DEFAULT] tflite_model = converter.convert() 即没有加入数据对输入和激活层均采用全量化处理,则可以正常使用。

上述的问题如何解决呢?