Hi everyone :)
I'm trying to use spaCy with GPU (CUDA 10.2) but I'm facing the following issue:
Traceback (most recent call last): [5/1106]
File "/srv/home/7schneid/miniconda3/envs/wikicaps/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/srv/home/7schneid/miniconda3/envs/wikicaps/lib/python3.8/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/srv/home/7schneid/miniconda3/envs/wikicaps/lib/python3.8/site-packages/spacy/language.py", line 1172, in _apply_pipes
sender.send([doc.to_bytes() for doc in docs])
File "/srv/home/7schneid/miniconda3/envs/wikicaps/lib/python3.8/site-packages/spacy/language.py", line 1172, in <listcomp>
sender.send([doc.to_bytes() for doc in docs])
File "nn_parser.pyx", line 249, in pipe
File "/srv/home/7schneid/miniconda3/envs/wikicaps/lib/python3.8/site-packages/spacy/util.py", line 517, in minibatch
batch = list(itertools.islice(items, int(batch_size)))
File "nn_parser.pyx", line 249, in pipe
File "/srv/home/7schneid/miniconda3/envs/wikicaps/lib/python3.8/site-packages/spacy/util.py", line 517, in minibatch
batch = list(itertools.islice(items, int(batch_size)))
File "pipes.pyx", line 405, in pipe
File "pipes.pyx", line 417, in spacy.pipeline.pipes.Tagger.predict
File "/srv/home/7schneid/miniconda3/envs/wikicaps/lib/python3.8/site-packages/thinc/neural/_classes/model.py", line 167, in __call__
return self.predict(x)
File "/srv/home/7schneid/miniconda3/envs/wikicaps/lib/python3.8/site-packages/thinc/neural/_classes/feed_forward.py", line 40, in predict
X = layer(X)
File "/srv/home/7schneid/miniconda3/envs/wikicaps/lib/python3.8/site-packages/thinc/neural/_classes/model.py", line 167, in __call__
return self.predict(x)
File "/srv/home/7schneid/miniconda3/envs/wikicaps/lib/python3.8/site-packages/thinc/neural/_classes/model.py", line 131, in predict
y, _ = self.begin_update(X, drop=None)
File "/srv/home/7schneid/miniconda3/envs/wikicaps/lib/python3.8/site-packages/thinc/neural/_classes/feature_extracter.py", line 14, in begin_update
features = [self._get_feats(doc) for doc in docs]
File "/srv/home/7schneid/miniconda3/envs/wikicaps/lib/python3.8/site-packages/thinc/neural/_classes/feature_extracter.py", line 14, in <listcomp>
features = [self._get_feats(doc) for doc in docs]
File "/srv/home/7schneid/miniconda3/envs/wikicaps/lib/python3.8/site-packages/thinc/neural/_classes/feature_extracter.py", line 22, in _get_feats
return self.ops.asarray(arr, dtype="uint64")
File "ops.pyx", line 1001, in thinc.neural.ops.CupyOps.asarray
File "/srv/home/7schneid/miniconda3/envs/wikicaps/lib/python3.8/site-packages/cupy/_creation/from_data.py", line 41, in array
return core.array(obj, dtype, copy, order, subok, ndmin)
File "cupy/core/core.pyx", line 2004, in cupy.core.core.array
File "cupy/core/core.pyx", line 2083, in cupy.core.core.array
File "cupy/core/core.pyx", line 2157, in cupy.core.core._send_object_to_gpu
File "cupy/core/core.pyx", line 138, in cupy.core.cor
Maybe it's because I'm also using a spaCy pipeline with multiple processes (n_processes is not 0 but set to an arbitrary 12)for doc in self.spacy_nlp.pipe(self.raw_df['caption'].astype(str), batch_size=100, n_process=self.n_workers): ......
Does anybody know how to resolve this problem?
I was able to resolve it by adding multiprocessing.set_start_method('spawn')
in my main method as the first statement.
This causes the process to spawn instead of forking apart from the process that initialized CUDA. The processes then all use CUDA quite efficiently
gpustat output:[7] GeForce RTX 2080 Ti | 38'C, 33 % | 9850 / 11019 MB | 7schneid(1037M) 7schneid(1519M) 7schneid(1541M) 7schneid(1491M) 7schneid(1405M) 7schneid(1355M) 7schneid(1485M)
Hello everyone! :) I have one question (also on stackoverflow: https://stackoverflow.com/questions/65680548/spacy-ignored-essential-entities-during-labeling-how-important-is-this-asp).
I'm training a custom Spacy model. Does it affect the results whether I leave entities unlabeled? For example, Germany is LOC. In one example (1) I label this. In the other example (2) I ignore it and label another entity:
Example 1: Germany (LOC) is a country in Central and Western Europe.
Example 2: Germany borders Denmark (LOC) to the north.
It's not about one entity that is occasionally ignored, but about several.
Hi, I am annotating a document with custom entities for a custom NER model, I realized that some entities have a lot of occurrences in the document hence having that many annotations, but some entities only have a few occurrences and annotations. The result of this is that the custom entities with few occurrences are not being identified in the testing stage by the Custom NER.
Please, let me know if there is a way to solve this problem in spaCy? Would really appreciate the help. Thanks :)
Hello everyone! :) I have one question (also on stackoverflow: https://stackoverflow.com/questions/65680548/spacy-ignored-essential-entities-during-labeling-how-important-is-this-asp).
I'm training a custom Spacy model. Does it affect the results whether I leave entities unlabeled? For example, Germany is LOC. In one example (1) I label this. In the other example (2) I ignore it and label another entity:
Example 1: Germany (LOC) is a country in Central and Western Europe.
Example 2: Germany borders Denmark (LOC) to the north.
It's not about one entity that is occasionally ignored, but about several.
If someone is interested, here is the answer: https://datascience.stackexchange.com/questions/88124/spacy-ignored-essential-entities-during-labeling-how-important-is-this-asp/88125#88125
Hi guys I have a quick question pertaining to the (semantic) similarity function performance in difference spacy versions
Has someone experienced this, any idea as to why this may be?
Hello.
I already have some experience using the basics of spaCy. Now, I want to take a step ahead and starting with some more spaCy utilities, lot of them related to spacy version 3 (config, project, custom models, transformers, etc.) .
I already read/worked-with all the spacy usage documentation, but it is too much and too extense, I need resources more practical, with examples etc. I also took a look to the explosion github projects, but I don't know what is recommended to start with. On other hand, I browsed the web looking for some tutorials or good material, but all resources I found only cover the basics of spaCy.
For the next months I will develope some NLP projects that implies the use of custom models and probably transformers. I want to carry out these projects using spacy best practises, but I don't know where to start to adquire such abilities.
So then, do someone recommend me practical material to go with, advices, etc. in order to get profiecience?
Thanks in advance.
hey everyone, I have successfully trained my first NER model BUT ray isn't output anything after it completes, any ideas? running this command
python -m spacy ray train ./training-spacy/config-2.cfg --paths.train ./datasets/train.spacy --paths.dev ./datasets/eval.spacy --address X.X.X.X:6379 -o output --n-workers 5
python 3.8, spacy3
Hey everyone, I figured out the issue, ray isn't creating the output folder, spacy train
worked.
New question, does anyone have any resources on how to break down AI/machine learning projects for a team? I am trying to get a better grasp on this to help with timelines and budgets. Thanks
Hey, I get
>>> spacy.require_gpu()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
raise ValueError("GPU is not accessible. Was the library installed correctly?")
ValueError: GPU is not accessible. Was the library installed correctly?
But GPU does work with pytorch..
>>> import torch
>>> torch.cuda.is_available()
True
>>> torch.cuda.current_device()
0
>>> torch.cuda.device(0)
<torch.cuda.device object at 0x7f07506bd730>
>>> torch.cuda.device_count()
4
>>> torch.cuda.get_device_name(0)
'TITAN Xp'
Any idea why it doesn't work with spacy??
Another questions:
When I try to train NER consists of transformers (by https://spacy.io/usage/training#quickstart) on small dataset consists 10K sentences it work amazing :D
But when I try to train on a bigger with 700K sentences it fail with out of memory errors...
How does it make sense??
I tries to make the batch_size smaller but it did not help.
Are there any formal paper describing the architectures suggested by ttps://spacy.io/usage/training#quickstart ?