gpt4 book ai didi

deep-learning - HUGGINGFACE 类型错误 : '>' not supported between instances of 'NoneType' and 'int'

转载 作者:行者123 更新时间:2023-12-05 02:39:54 25 4
gpt4 key购买 nike

我正在自定义(使用 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'

最佳答案

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

安装 4.6.0 版对我有用。

pip install transformers==4.6.0

关于deep-learning - HUGGINGFACE 类型错误 : '>' not supported between instances of 'NoneType' and 'int' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68875496/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com