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

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

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

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'

似乎是新版变形金刚的问题。

我安装了 4.6.0 版。

pip install transformers==4.6.0