【问题标题】:BERT error - module 'tensorflow_core.keras.activations' has no attribute 'swish'BERT 错误 - 模块“tensorflow_core.keras.activations”没有属性“swish”
【发布时间】:2022-01-29 21:23:03
【问题描述】:

我正在尝试执行转换器模型,但最终出现错误。

  • Python 版本 == 3.7
  • 张量流 == 2.0
  • 变形金刚 == 4.15.0

来源:https://huggingface.co/cross-encoder/nli-deberta-base?candidateLabels=supply+chain%2C+scientific+discovery%2C+microbiology%2C+robots%2C+archeology&multiClass=false&text=shipment+will+arrive+on+next+week.+our+company+will+transport

我的代码:

import tensorflow
from transformers import pipeline, AutoModelForTokenClassification,BertTokenizer
pipeline("zero-shot-classification",model="cross-encoder/nli-deberta-v3-small")

错误:模块“tensorflow_core.keras.activations”没有属性“swish”

【问题讨论】:

    标签: python nlp tensorflow2.0 bert-language-model transformer


    【解决方案1】:

    我尝试安装 Tensorflow==2.3 并重新启动机器。现在错误消失了......

    【讨论】:

      猜你喜欢
      • 2021-02-13
      • 2020-07-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-29
      • 2021-07-17
      • 2021-09-25
      • 2018-01-21
      相关资源
      最近更新 更多