Open kpich opened 3 years ago
Hey, seems like it works as expected (i.e. doesn't crash) on linux? Error above was from running on OSX 10.14.6.
(FYI I suspect it might something to do with multiprocessing using spawn rather than fork by default on OSX as of py3.8 [doc link] but IDK)
Interesting, not sure off the top of my head. Leaving this open for now, let me know if you happen to resolve anything. At a minimum, you could do the parallelization yourself, but ideally it would work with spacy's parallelization.
I actually initially tried doing the parallelization myself with joblib, calling nlp()
inside the parallelized code, and it gave me the same error as the spacy nlp.pipe
snippet I posted.
Will let you know if I come across anything, but it seems to work fine on linux fwiw.
Hi, I'm getting an error trying to run
nlp.pipe
withn_processes > 1
, I think because the pickling thatmultiprocessing
does under the hood interacts poorly withnmslib.dist.FloatIndex
, which the rxnorm entity linker requires and does not seem picklable.Minimal code:
Running with Python 3.8.5 gives me:
Note I don't get an error with
n_process=1
, presumably becausemultiprocessing
is not invoked.I also do not get this error if I don't include the linker pipe (i.e. comment out the
add_pipe()
line above).Thanks! This lib is great!