【问题标题】:tflite With Dynamic Size Input Shape具有动态大小输入形状的 tflite
【发布时间】:2023-03-20 07:23:01
【问题描述】:

我正在将 .pb 模型转换为 tflite。我在推理时使用具有完全卷积网络的图像金字塔。但它显示了这个错误(不使用 resize_tensor_input)

ValueError: Cannot set tensor: Dimension mismatch. Got 150 but expected 300 for dimension 1 of input 35.

在 allocate_tensors() 之前使用 resize_tensor_input 后​​再次抛出错误。

RuntimeError: tensorflow/lite/kernels/reshape.cc:66 num_input_elements != num_output_elements (13300 != 56550)Node number 26 (RESHAPE) failed to prepare.

我的 tensorflow 版本是 1.15.2 我们如何设置具有动态大小的 tflite 输入张量?

【问题讨论】:

    标签: python tensorflow tensorflow-lite


    【解决方案1】:

    TFLite 在 2.x 版本中有很多改进,具有更好的转换器和操作支持。您可能想在 TF 2.X 版本中尝试一下。

    要将 TF1 迁移到 TF2, 请查看https://www.tensorflow.org/guide/migrate

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-09
      • 1970-01-01
      • 2015-09-23
      • 1970-01-01
      • 1970-01-01
      • 2017-04-28
      相关资源
      最近更新 更多