【问题标题】:Integrated Gradients Error - Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor集成梯度错误 - 尝试将具有不受支持的类型 (<class 'NoneType'>) 的值 (None) 转换为张量
【发布时间】:2021-11-26 12:42:17
【问题描述】:

我是变形金刚的新手,但我设法使用 tensorflow 创建了一个 Bert 分类器,现在我想实现积分梯度来解释模型,但是我收到了这个错误:

尝试将具有不受支持类型 () 的值 (None) 转换为张量

如果您认为可以提供帮助,请在此处找到我的代码:link,因为此处粘贴的代码很多。

【问题讨论】:

    标签: nlp gradient bert-language-model


    【解决方案1】:

    在你的笔记本中,错误是由

    触发的
    explanation = ig.explain(a,
                             baselines=None,
                             target=predictions)
    

    因此,ig 似乎需要非空基线。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-22
      • 1970-01-01
      • 1970-01-01
      • 2018-11-22
      相关资源
      最近更新 更多