android - 在 Android 设备上加载基于 tflite 的估计器模型的问题
问题描述
我在结构化数据上生成了一个 Boosted Trees Estimator,并尝试使用该估计器在移动设备上进行预测。但我面临的问题是,当我启动应用程序时,该应用程序会在 Android Studio 中生成以下错误。
2020-09-30 12:26:34.892 8966-8966/com.example.tflitetest W/System.err: java.lang.IllegalStateException: Internal error: Unexpected failure when preparing tensor allocations: Encountered unresolved custom op: ParseExampleV2.
2020-09-30 12:26:34.892 8966-8966/com.example.tflitetest W/System.err: Node number 0 (ParseExampleV2) failed to prepare.
我按照本指南进行了估算器培训,下面突出显示的代码:
tf.feature_column.make_parse_example_spec([input_column]))
estimator_base_path = os.path.join(tmpdir, 'from_estimator')
estimator_path = estimator.export_saved_model(estimator_base_path, serving_input_fn)
(如果我做错了什么,请告诉我。)
所有数据文件(训练/测试数据、示例 Android 应用程序和 .tflite 模型)都可以在 Google Drive 的以下链接上找到: https ://drive.google.com/drive/folders/1-qDhCJGNZyqu_-XoMyW0kvimyiDdMndO?usp=sharing
编辑1:解析示例的用法包含在问题中。
解决方案
推荐阅读
- firebase - Firebase 云功能在 https.onrequest() 上读取/更新数据库
- excel - 仅复制和粘贴具有值的单元格
- node.js - 使用 mongoose 应该使用哪种方法来更新 mongodb 中的文档?
- sql - 在 postgresql 中查看
- java - 为什么计时器忽略格式?
- javascript - 如何在 Nuxt 中渲染异步和动态组件?
- c - 将指针转换为用于散列的数值 - 我应该使用 `uintptr_t` 还是 `intptr_t`?
- javascript - 如何等待 js 导出的 api 调用?
- google-cloud-platform - Google Cloud Build 总是连接到错误的 GitHub 帐户
- java - 从嵌套的 HashMap 中收集