tensorflow lite 转换失败。“未定义符号:_ZTIN10tensorflow6DeviceE”发生

sor*_*ive 5 tensorflow tensorflow-lite transfer-learning

tflite_model = converter.convert()
tflite_model_file = 'converted_model.tflite'

with open(tflite_model_file, "wb") as f:
  f.write(tflite_model)
Run Code Online (Sandbox Code Playgroud)

当我最终在 dot convert 方法中转换模型时,出现了一些错误。

错误信息:

ValueError: Failed to parse the model: /tensorflow-2.1.0/python3.6/tensorflow_core/lite/python/optimize/_tensorflow_lite_wrap_calibration_wrapper.so: undefined symbol: _ZTIN10tensorflow6DeviceE.
Run Code Online (Sandbox Code Playgroud)

源代码:

https://colab.research.google.com/github/tensorflow/examples/blob/master/courses/udacity_intro_to_tensorflow_lite/tflite_c02_transfer_learning.ipynb#scrollTo=BbTF6nd1KG2o

即使通过我没有找到什么是

_ZTIN10tensorflow6DeviceE
Run Code Online (Sandbox Code Playgroud)

如何转换迁移学习模型?

小智 4

我遇到了同样的问题 - 安装夜间构建(当前为“2.1.0-dev20200104”)解决了它。

!pip3 uninstall tensorflow
!pip3 install tf-nightly
Run Code Online (Sandbox Code Playgroud)