【问题标题】:This model is not supported: Input tensor 0 does not have a name不支持此模型:输入张量 0 没有名称
【发布时间】:2021-04-12 21:43:15
【问题描述】:

在 Android Studio 上,我无法查看模型元数据,即使我已经在 Python 中手动添加了元数据。我得到了错误:

不支持此模型:输入张量 0 没有名称。

我的修复尝试:

我将层名称添加到 tensorflow 输入层,使用:

img_input = Input(shape=input_shape, batch_size=1, name="input_image")

我什至在 Netron 中检查过,输入层显示为 input_image,正如预期的那样:

【问题讨论】:

    标签: android-studio tensorflow-lite


    【解决方案1】:

    我通过从 documentation 复制 1 行来修复它,我需要将特定属性添加到 TensorMetadataT 对象 input_meta.name = "image"。这不是来自模型层名称,而是需要手动添加。

    input_meta.name = "image_input"
    

    奇怪的是:以前这不是问题,但由于某种原因,我之前的代码坏了,我需要进行此更改。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多