简体   繁体   English

加载已经训练过的 ner spacy model 时出错

[英]Error loading already trained ner spacy model

I'm trying to load an already trained NER model, which was loading normally until today, but I'm getting the following error, either importing the trained model or importing pt_core_news_lg:我正在尝试加载一个已经训练过的 NER model,它在今天之前一直正常加载,但是我收到以下错误,导入训练过的 model 或导入 pt_core_news_lg:

nlp4 = spacy.load('/content/gdrive/My Drive/spacy_NER4')

ValueError: Cannot create vectors table with dimension 0. If you're using pre-trained vectors, are the vectors loaded? ValueError:无法创建维度为 0 的向量表。如果您使用的是预训练向量,是否已加载向量?

I'm on Google Colab, following the installations:安装后,我在 Google Colab 上:

.pip install spacy==2.3.4

!python -m spacy download pt_core_news_lg

When I import my model, it generates this error.当我导入 model 时,它会生成此错误。 Does anyone have a tip or solution to this problem?有没有人有这个问题的提示或解决方案?

If I install spacy-nightly it throws another error:如果我每晚安装 spacy-nightly 它会抛出另一个错误:

OSError: [E053] Could not read config.cfg from /content/gdrive/My Drive/space_NER4/config.cfg OSError: [E053] 无法从 /content/gdrive/My Drive/space_NER4/config.cfg 读取 config.cfg

However, when loading pt_core_news_lg, it loads normally但是加载pt_core_news_lg时,加载正常

I solved this error by changing google account.我通过更改谷歌帐户解决了这个错误。 I simply imported all my templates into the other account and it worked.我只是将我所有的模板导入到另一个帐户中并且它起作用了。 However, the reason for the error of not loading in the account, I did not find但是,账户加载不上报错的原因,我没找到

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM