【问题标题】:How to add custom operator in Tensorflow Lite with attributes如何在 Tensorflow Lite 中使用属性添加自定义运算符
【发布时间】:2017-12-14 16:30:24
【问题描述】:

我按照以下说明在 Tensorflow 中添加了自定义运算符: https://www.tensorflow.org/extend/adding_an_op

现在我想将相同的运算符添加到 Tensorflow Lite。 我按照this 说明在 TF Lite 中添加自定义运算符,但它没有说明如何添加具有属性的自定义运算符。 像这样:

REGISTER_OP("CustomOpName")
.Attr("T: {float}")
.Attr("scale_factor: int")
.Input("x: T")
.Output("out: T")

我尝试像内置运算符一样将 TfLiteNode* 节点转换为自定义参数结构,如 TfLiteLocalResponseNormParams,但问题是 TfLiteNode* 节点等于 NULL。

【问题讨论】:

  • 你找到解决方案了吗?
  • 您提供的说明链接最近更新了。我已成功添加新操作,没有任何问题。

标签: c++ tensorflow tensorflow-lite


【解决方案1】:

您可以像mfcc kernel 一样执行此操作。您在自定义 tensorflow 操作中定义的属性将显示为 flexbuffer,并且可以轻松查询。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-12
    • 2018-02-26
    • 1970-01-01
    • 2021-04-28
    • 2011-08-08
    • 2012-01-13
    相关资源
    最近更新 更多