April 2020
May 2020
请问一下这段代码:
converter = tf.lite.TFLiteConverter.from_saved_model ('saved/1')
converter.optimizations = [tf.lite.Optimize.DEFAULT]
tflite_quant_model = converter.convert ()
open ("mnist_savedmodel_quantized.tflite", "wb").write (tflite_quant_model)
为什么会报错
raise ValueError ("No ConcreteFunction is specified.")
ValueError: No ConcreteFunction is specified.
使用的环境为:
tensorflow==2.0.0
tensorflow-estimator==2.0.1
tensorflow-hub==0.8.0
打开 site-packages/tensorflow/lite/python/lite.py 文件发现其实是 from_saved_model 的时候构造_funcs 为空,不太清楚里面的机制,这里请教下一哎。
May 2020
July 2020
你好,我在使用 TFLiteConverter.from_saved_model 时遇到一个奇怪的问题
tensorflow.lite.python.convert.ConverterError: :0: error: loc (“gru/gru_cell/bias”): is not immutable, try running tf-saved-model-optimize-global-tensors to prove tensors are immutable
:0: note: loc (“gru/gru_cell/bias”): see current operation: “tf_saved_model.global_tensor”() {is_mutable, sym_name = “gru/gru_cell/bias”, type = tensor<2x384xf32>, value = dense<“很长,就删掉了”> : tensor<2x384xf32>} : () -> ()
模型有调用 GRU 单元,但是之前的训练和测试都没有问题,是和 TFlite 有关吗?版本是 tensorflow2.2,python3.7
February 2021
你好不好意思我正在嘗試練習將 “.tflite” 部署到Android Studio,關於 "載入模型"那部分,我能問一下memory-map那段程式碼是要加在Android Studio 的哪個目錄檔案嗎? 謝謝你。
December 2021
请问为什么TF1.15 转换的tflite 激活函数会被融合,但是TF2.5转换的tflite的激活函数不会被融合?netron上显示如下:
TF1.15

TF2.5:
