如果我在MLKit中使用Pre-Trained TFLite Object detection model,则会出现以下错误:
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).
知道我可能在做什么错吗?
答案 0 :(得分:3)
ML Kit当前尚不支持自定义对象检测模型。 ML Kit当前仅允许开发人员使用自定义图像分类模型。此处列出了与ML Kit兼容的所有TFLite型号:
https://tfhub.dev/ml-kit/collections/image-classification/1
如果要进行对象检测,可以尝试ML Kit的对象检测API:https://developers.google.com/ml-kit/vision/object-detection
如果要使用自定义对象检测模型,可以尝试使用TFLite任务库:
https://www.tensorflow.org/lite/inference_with_metadata/task_library/overview。