【问题标题】:How can I change the number of dimensions for output of a TFlite model?如何更改 TFlite 模型输出的维数?
【发布时间】:2021-04-09 19:18:56
【问题描述】:

我正在将 Google 的 MLKit 用于 Android 应用程序来进行对象检测。 我知道有一些 TFlite 模型与 MLKit 兼容,但是当我大部分时间使用其他模型时,我都会遇到这个错误:

 com.google.android.gms.tasks.RuntimeExecutionException: com.google.mlkit.common.MlKitException: Failed to initialize detector. 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).

我想知道是否有可能(以及如何)操纵输入/输出(对于某些模型,问题是其他输出的输入)以满足此处对 MLKit 的要求:https://developers.google.com/ml-kit/custom-models#model-compatibility

我正在尝试将方形猪放入圆孔中?

【问题讨论】:

    标签: android tensorflow-lite google-mlkit


    【解决方案1】:

    不要试图将方猪[原文如此] 放入圆孔中 - 这对方猪来说会很痛苦。您可以在这里选择一个与 ML Kit 兼容的模型圆猪:

    https://tfhub.dev/ml-kit

    【讨论】:

      猜你喜欢
      • 2023-01-17
      • 2021-08-13
      • 1970-01-01
      • 2022-01-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-29
      相关资源
      最近更新 更多