【问题标题】:Huggingface Transformers - AttributeError: 'MrpcProcessor' object has no attribute 'tfds_map'Huggingface 变形金刚 - AttributeError:“MrpcProcessor”对象没有属性“tfds_map”
【发布时间】:2020-04-15 08:47:01
【问题描述】:

在 GLUE 任务上使用 Hugginface Transformers 时,出现错误 AttributeError: 'MrpcProcessor' object has no attribute 'tfds_map'

我怀疑存在兼容性问题。

【问题讨论】:

    标签: transformer bert-language-model huggingface-transformers


    【解决方案1】:

    我的解决方案是简单地将转换器的版本降级到 2.2.0

    pip uninstall transformers -y

    pip install transformers==2.2.0

    【讨论】:

    • 我需要 2.3.0,因为 2.2.0 还没有提供我开始使用和欣赏的管道类。弓我遇到了同样的错误。你不会碰巧有另一个想法而不是降级,是吗?谢谢
    【解决方案2】:

    现在我正在使用transformers 2.11.0,这段代码对我有用:

    # First we create an empty Byte-Pair Encoding model (i.e. not trained model)
    tokenizer = Tokenizer(BPE())
    tokenizer.normalizer = Sequence([
        NFKC(),
        Lowercase()
    ])
    

    所以似乎有一个可以使用的构造函数。

    【讨论】:

      猜你喜欢
      • 2020-11-18
      • 2021-06-23
      • 2014-04-03
      • 2020-08-24
      • 2021-09-05
      • 2016-05-09
      • 2015-05-07
      • 2020-04-24
      相关资源
      最近更新 更多