与GCP Vision的自定义对象检测器模型发行
我的完整技术堆栈是:
- 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/mlkit
and 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题完全与错误消息所说:
获得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.