Transformer stuck at zero loss #12211
-
Hello, I am working on a NER project and I am trying to create a pipeline with both transformer and NER in it. So far its a pretty simple code however I see that while training the loss of the transformer is 0 and I have no movement there while I can clearly see that the NER is "learning".
And the output as follows:
I have dabbled around the forums and other resources but unfortunately I can't find why the NER is not listening to the transformer or vice versa. Any help would be greatly appreciated. P.S. Amazing platform and product, keep the work going! P.S 2 I appreciate I am using a training loop as that's not suggested in spacy v3 but my circumstances enforce it. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
When you add an NER component to your pipeline without a config, it uses the default config. The default config uses an embedded CNN tok2vec rather than a listener, so it has no way to interact with the Transformer. I would recommend you use the training widget to generate a config with a transformer and examine it for an example of working settings. Even if you must use a training loop, you can copy the config settings into your code. Can you elaborate on why you can't use a config file? |
Beta Was this translation helpful? Give feedback.
When you add an NER component to your pipeline without a config, it uses the default config. The default config uses an embedded CNN tok2vec rather than a listener, so it has no way to interact with the Transformer.
I would recommend you use the training widget to generate a config with a transformer and examine it for an example of working settings. Even if you must use a training loop, you can copy the config settings into your code.
Can you elaborate on why you can't use a config file?