【问题标题】:distilbert model is not working at ktraindistilbert 模型不适用于 ktrain
【发布时间】:2020-11-28 08:01:58
【问题描述】:

我尝试使用 distilbert 分类器。但我收到以下错误。

这是我的代码

(X_train,y_train),(X_test,y_test),prepro 
=text.texts_from_df(train_df=data_train,text_column="Cleaned",label_columns=col

,val_df=data_test,maxlen=500,preprocess_mode="distilbert")

这是错误

OSError: Model name 'distilbert-base-uncased' was not found in tokenizers model name list (distilbert-base-uncased, distilbert-base-uncased-distilled-squad, distilbert-base-cased, distilbert-base-cased-distilled-squad, distilbert-base-german-cased, distilbert-base-multilingual-cased). We assumed 'distilbert-base-uncased' was a path, a model identifier, or url to a directory containing vocabulary files named ['vocab.txt'] but couldn't find such vocabulary files at this path or url._

由于我办公室当前的环境问题,我只能在 tf 2.2 和 python 3.8 上工作。现在我使用的是 0.19。

如果我将它降级到 0.16,你认为它会影响我当前的环境吗?

【问题讨论】:

    标签: distilbert ktrain


    【解决方案1】:

    如果存在阻止下载标记器文件的网络或防火墙问题,则可能会发生此错误。有关补救措施,请参阅 this FAQ entry

    此外,当您使用 preprocess_mode='distilbert' 时,texts_from* 函数返回 TransformerDataset 实例,而不是数组。例如,您需要将(X_train, y_train) 替换为train_data。见this example notebook

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-04-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-29
      • 2021-07-13
      • 2019-07-03
      • 2019-10-06
      相关资源
      最近更新 更多