类型错误:“无类型”对象不可调用(XLNet Classifer)
我正在尝试使用Tokenizer,Keras和TensorFlow训练我的模型。 我在哪里遇到错误的代码。
from transformers import TFXLNetModel, XLNetTokenizer
xlnet_model = 'xlnet-large-cased'
xlnet_tokenizer = XLNetTokenizer.from_pretrained(xlnet_model)
错误:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果运行代码,您将首先获得此错误:
运行
!PIP安装句子
并重新启动单元格typeerror
发生。要解决此问题,您需要重新启动运行时。单击“运行时 - >重新启动运行时”,然后再次运行单元格。
我在
transformers
repo中找到了此解决方案,。If you run the code you will first get this error:
After running
!pip install sentencepiece
and restarting the cell theTypeError
happens.To fix this you need to restart your runtime. Click "Runtime -> Restart Runtime", then run your cells again.
I found this solution on the
transformers
repo in this issue report.