错误为:;
Traceback (most recent call last):
File "main.py", line 108, in
fire.Fire()
File "D:\software\Anaconda3\envs\ynt2\lib\site-packages\fire\core.py", line 138, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "D:\software\Anaconda3\envs\ynt2\lib\site-packages\fire\core.py", line 468, in _Fire
target=component.name)
File "D:\software\Anaconda3\envs\ynt2\lib\site-packages\fire\core.py", line 672, in _CallAndUpdateTrace
component = fn(*varargs, *kwargs)
File "main.py", line 69, in train
output = model(x)
File "D:\software\Anaconda3\envs\ynt2\lib\site-packages\torch\nn\modules\module.py", line 550, in call
result = self.forward(input, **kwargs)
File "C:\Users\YNT\Desktop\重要文件夹\数据集\EMLo相关\pytorch_bert_elmo_example-master\model.py", line 40, in forward
word_embs = self.get_bert(x)
File "C:\Users\YNT\Desktop\重要文件夹\数据集\EMLo相关\pytorch_bert_elmo_example-master\model.py", line 90, in get_bert
ids = self.tokenizer(sentence_lists, padding=True, return_tensors="pt")
TypeError: 'BertTokenizer' object is not callable
错误为:; Traceback (most recent call last): File "main.py", line 108, in
fire.Fire()
File "D:\software\Anaconda3\envs\ynt2\lib\site-packages\fire\core.py", line 138, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "D:\software\Anaconda3\envs\ynt2\lib\site-packages\fire\core.py", line 468, in _Fire
target=component.name)
File "D:\software\Anaconda3\envs\ynt2\lib\site-packages\fire\core.py", line 672, in _CallAndUpdateTrace
component = fn(*varargs, *kwargs)
File "main.py", line 69, in train
output = model(x)
File "D:\software\Anaconda3\envs\ynt2\lib\site-packages\torch\nn\modules\module.py", line 550, in call
result = self.forward(input, **kwargs)
File "C:\Users\YNT\Desktop\重要文件夹\数据集\EMLo相关\pytorch_bert_elmo_example-master\model.py", line 40, in forward
word_embs = self.get_bert(x)
File "C:\Users\YNT\Desktop\重要文件夹\数据集\EMLo相关\pytorch_bert_elmo_example-master\model.py", line 90, in get_bert
ids = self.tokenizer(sentence_lists, padding=True, return_tensors="pt")
TypeError: 'BertTokenizer' object is not callable
可是发现您代码里并不存在BertTokenizer对象?