与GCP Vision的自定义对象检测器模型发行

发布于 2025-02-02 13:05:42 字数 1062 浏览 4 评论 0原文

我的完整技术堆栈是:

  • GCP ML Vision。
  • 导出到Tflite格式(来自同一GCP控制台)的模型。
  • iOS开发的XCode
  • iPhone 11 Pro

我正在尝试使用MLKIT和一种在GCP Automl Vision中训练的自定义对象检测器。
我创建了模型并将其导出为 tflite 文件,但是当尝试执行objectdetector processImage:visionImage时,我总是会收到错误:
错误域= com.google.visionkit.pipeline.error代码= 3“管道无法完全启动: calculatorgraph :: run()在运行中失败: 计算器:: Open()对于节点“ BoxClassifierCalculator”失败:#vk意外的输出索引数量0: 获得3D,预期的是2D(B = 1)或4D(B = 1,W = 1,H = 1)。 userInfo = {com.google.visionkit.status =< mlkitvk_vnkstatuswrapper:0x280841270>,nslocalizedDescriptionDescriptionDeScription = pipeline = pipeline dipleline dipple ofter启动: calculatorgraph :: run()在运行中失败: 计算器:: Open()对于节点“ BoxClassifierCalculator”失败:#vk意外的输出索引数量0: 获得3D,预期的是2D(B = 1)或4D(bxhxwxn,b = 1,w = 1,h = 1)。}
我已经从https://github.com/googlesamples/mlkit下载了MLKIT示例,当我尝试替换自己的tflite文件时,Vision Project(检测鸟)中有类似的东西,它以与我自己的项目完全相同的方式破裂。
我认为Tflite是像MlVision一样完全不同的。
有洞察力吗? (对不起,如果这很明显,但是我对Tensorflow和Mlvision非常新鲜) 提前致谢

My full tech stack is:

  • GCP ML Vision.
  • Exported Model to tflite format (from the same GCP console).
  • XCode for iOS development
  • iPhone 11 pro

I am trying to use a Custom Object detector using MLKit and one model trained in GCP AutoML Vision.
I created the model and exported as tflite file, but when trying to do objectDetector processImage:visionImage, I always get the error:
Error Domain=com.google.visionkit.pipeline.error Code=3 "Pipeline failed to fully start:
CalculatorGraph::Run() failed in Run:
Calculator::Open() for node "BoxClassifierCalculator" failed: #vk Unexpected number of dimensions for output index 0:
got 3D, expected either 2D (BxN with B=1) or 4D (BxHxWxN with B=1, W=1, H=1)."
UserInfo={com.google.visionkit.status=<MLKITvk_VNKStatusWrapper: 0x280841270>, NSLocalizedDescription=Pipeline failed to fully start:
CalculatorGraph::Run() failed in Run:
Calculator::Open() for node "BoxClassifierCalculator" failed: #vk Unexpected number of dimensions for output index 0:
got 3D, expected either 2D (BxN with B=1) or 4D (BxHxWxN with B=1, W=1, H=1).}
.
I have downloaded the mlkit examples from https://github.com/googlesamples/mlkitand there is something similar in the vision project, (to detect birds) when I try to replace my own tflite file, it breaks in the exact same way as in my own project.
I presume the tflite is created in a very different way as MLVision does.
Any insight? (Sorry if this is so obvious, but I'm pretty new to TensorFlow and MLVision)
Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

山田美奈子 2025-02-09 13:05:42

问题完全与错误消息所说:获得3D,预期的是2D(B = 1)或4D(BXHXWXN,B = 1,W = 1,H = 1)。这意味着您的模型与ML试剂盒不兼容,因为其张量的尺寸不正确。指定模型兼容性要求在这里

The issue is exactly as what the error message says: got 3D, expected either 2D (BxN with B=1) or 4D (BxHxWxN with B=1, W=1, H=1). That means your model is not compatible with ML Kit, as its tensor has incorrect dimension. The model compatibility requirements are specified here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文