LeeSureman / Flat-Lattice-Transformer

code for ACL 2020 paper: FLAT: Chinese NER Using Flat-Lattice Transformer
1k stars 178 forks source link

请问下fastNLP有两个函数import失败是版本问题吗 #54

Open CarlLinGitHub opened 3 years ago

CarlLinGitHub commented 3 years ago

from fastNLP.modules.utils import _get_file_name_base_on_postfix from fastNLP.embeddings.bert_embedding import _WordBertModel 我安装的fastNLP中并没有这两个函数,请问怎么解决呢

RabinLiu commented 3 years ago

fastNLP版本问题吧,我最开始安装的最新版本也是import错误,改到0.5.0问题没了,不过使用cpu跑的时候fastNLP有bug,要将Trainer里的device设为 device=‘cpu’,不然会报错,新版本的fastNLP修正了此bug

LeeSureman commented 3 years ago

from fastNLP.modules.utils import _get_file_name_base_on_postfix from fastNLP.embeddings.bert_embedding import _WordBertModel 我安装的fastNLP中并没有这两个函数,请问怎么解决呢

先试试更新到最新版本吧

zhouxidong commented 3 years ago

image 请问您遇到这个问题吗

'FloatProgress' object has no attribute 'style' 应该是关于tqdm的

Aenchanteda commented 2 years ago

wordbertmodel这个import失败是fastnlp版本不一样,应该用0.6.0的,改成BertWordModel