【问题标题】:tflite : is there any way for tflite to handle various shape of inputtflite : tflite 有什么方法可以处理各种形状的输入
【发布时间】:2018-05-30 06:51:52
【问题描述】:

我想在 tflite 中使用 MTCNN 进行 人脸检测,它应该适用于像

这样的可变输入形状

both 1920*1080 or 640*360

但是 tflite 必须将输入形状设置为某个值,有没有办法让 tflite 接受可变输入或输出形状? 非常感谢

【问题讨论】:

    标签: tensorflow tensorflow-lite


    【解决方案1】:

    如果模型架构支持可变输入形状,您应该能够调用resizeInput API (Java) 或ResizeInputTensor API(如果您使用的是 C++)。

    例如,在 Java 中:

    interpreter.resizeInput(tensor_index, [1, 1920, 1080, 3]);
    interpreter.resizeInput(tensor_index, [1, 640, 360, 3]);
    

    请注意,许多网络架构(例如 MobileNet、Inception、ResNet...等)不支持可变输入形状。

    如果您确定模型应该支持可变输入形状并且它不起作用。请提交 Github 问题或在此处回复。

    【讨论】:

      猜你喜欢
      • 2023-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-25
      • 2020-04-20
      • 1970-01-01
      相关资源
      最近更新 更多