【问题标题】:Error with using BERT model from Tensorflow使用来自 Tensorflow 的 BERT 模型时出错
【发布时间】:2021-03-25 15:30:02
【问题描述】:

我已尝试按照 Tensorflow 说明使用 BERT 模型:(https://www.tensorflow.org/tutorials/text/classify_text_with_bert)

但是,当我运行这些行时:

text_test = ['this is such an amazing movie!']
text_preprocessed = bert_preprocess_model(text_test)

我收到以下错误:

InvalidArgumentError:尝试使用错误的类型访问资源。预期类 tensorflow::lookup::LookupInterface 得到类 tensorflow::lookup::LookupInterface [[{{node StatefulPartitionedCall/StatefulPartitionedCall/bert_tokenizer/StatefulPartitionedCall/WordpieceTokenizeWithOffsets/WordpieceTokenizeWithOffsets/WordpieceTokenizeWithOffsets}}]] [Op:__inference_restored_function_body_72474]

这两个类完全一样:“tensorflow::lookup::LookupInterface”。有人可以帮忙吗?谢谢。

【问题讨论】:

标签: python tensorflow bert-language-model


【解决方案1】:

我在 GitHub 上找到了这个错误报告:https://github.com/tensorflow/text/issues/476

他们似乎已经承认这是一个错误并正在尝试修复它。

【讨论】:

    【解决方案2】:

    我在 Windows 10 中也遇到了同样的错误。 然后我在wsl2 ubuntu 18.04中试了一下,效果很好。 在wsl2 ubuntu中试试怎么样

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-12-21
      • 2021-09-23
      • 2020-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-29
      相关资源
      最近更新 更多