Unable to load vectors when training textcat (textcat.model has no attribute toke2vec') #6406
-
Your Environment
I am trying to train a text classifier. I am following the example from https://spacy.io/usage/examples#training. However, it looks like I am unable to load custom vectors as evidenced in the error message below: Is the method of loading vectors different for version 2.3.1? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
It looks like If that's not the problem - could you please post a minimal, working code snippet that reproduces the error, and the full stack trace (pasted, not as screenshot)? |
Beta Was this translation helpful? Give feedback.
-
|
@svlandeg Ah! I know what the problem was -- For some reason, I put I have a follow up question. Is it possible to load vectors from another model? I tried the following: I got the following error: Thanks for the help! |
Beta Was this translation helpful? Give feedback.
-
|
The The best way to accomplish this, is to create your new You could have also just loaded that model without any of the pretrained components, effectively keeping the vocab/vectors only: or just download the vectors model: You can read more about vectors and serialization in the docs: https://spacy.io/usage/vectors-similarity & https://spacy.io/usage/saving-loading. Have fun ;-) |
Beta Was this translation helpful? Give feedback.


@svlandeg Ah! I know what the problem was -- For some reason, I put
nlp.begin_training()before the lines that load vectors, which is why the model was not properly initialized. Once I movednlp.begin_training()up, the model became properly initiated.I have a follow up question. Is it possible to load vectors from another model? I tried the following:
I got the following error:
Thanks for the help!