【问题标题】:HUGGINGFACE TypeError: '>' not supported between instances of 'NoneType' and 'int'HUGGINGFACE TypeError:“NoneType”和“int”的实例之间不支持“>”
【发布时间】:2021-10-22 19:03:57
【问题描述】:

我正在对自定义(使用 HuggingFace)数据集进行微调预训练模型我将从一个 youtube 视频中正确复制所有代码,一切正常,但在此单元格/代码中:

with training_args.strategy.scope():
    model=TFDistilBertForSequenceClassification.from_pretrained("distilbert-base-uncased")

    trainer = TFTrainer(model=model,     # the instantiated ???? Transformers model to be trained
    args=training_args,                  # training arguments, defined above
    train_dataset=train_dataset,         # training dataset
    eval_dataset=test_dataset)           # evaluation dataset


    trainer.train()

它会给我这个错误:

TypeError: '>' not supported between instances of 'NoneType' and 'int'

【问题讨论】:

  • 也许这更适合 Huggingface Github 上的问题。

标签: deep-learning data-science huggingface-transformers huggingface-tokenizers huggingface-datasets


【解决方案1】:

似乎是新版转换器的问题。

安装 4.6.0 版对我有用。

pip install transformers==4.6.0

【讨论】:

  • 谢谢,这在 Google Colab 上对我有用
猜你喜欢
  • 2020-06-02
  • 2019-08-14
  • 2017-09-28
  • 2022-01-20
  • 1970-01-01
  • 2018-01-10
  • 2020-05-05
  • 2021-03-18
  • 2018-11-22
相关资源
最近更新 更多