我想为Bert导入BertModelLayer,但我一直收到错误的ImportError: cannot import name 'BertModelLayer' from 'bert',我已经安装了bert,但仍然有相同的错误。
from bert import BertModelLayerBertModelLayer的正确安装是什么?
发布于 2021-11-16 06:50:56
安装命令为:
pip install bert-for-tf2然后,您可以使用:
from bert import BertModelLayer我假设您使用的是tensorflow-2
发布于 2021-11-15 13:01:55
也许你正在寻找一个不同的包?
请尝试安装bert-tensorflow,因为bert不是包的名称。
https://stackoverflow.com/questions/69974749
复制相似问题