Tensorflow Lite on MLKit giving this error: : #vk Got 1 class(es) for output index 0, expected 2 according to the label map

Tensorflow Lite on MLKit giving this error: : #vk Got 1 class(es) for output index 0, expected 2 according to the label map

将元数据添加到我的 tflite 文件以在 ML Kit 中使用它后,出现错误 Calculator::Open() for node "ClassifierClientCalculator" failed: #vk Got 1 class(es) for output index 0, expected 2 according to the label map. 我已经编辑了元数据中 类 的数量以及 类 在标签文件中,我仍然得到同样的错误。我的模型是二值图像分类模型,所以第一个应该有2个类。

基于https://developers.google.com/ml-kit/custom-models#model-compatibility,如果输出包含两个类,则输出应为(1 * 2)或(1 * 1 * 1 * 2)。你能仔细检查你的输出层吗?