pandarallel
pandarallel copied to clipboard
free(): invalid pointer
Running parallel_apply on a lambda function stops, then gives an error "free(): Invalid Pointer", which appears to be a C error.
Also, MMM appears occasionally- see attached image.
Code to reproduce is word_vecs = raw_text.parallel_apply(lambda x: get_vecs(w2v_model, x))
where get_vecs()
is:
def get_vecs(w2v_model, sentence):
yyy = []
for y in sentence.split(' '):
try:
yyy.append(w2v_model.wv[y])
except:
yyy.append(np.zeros(500))
return np.asarray(yyy).astype('float64')
and sentence
is a UTF-8 string
Doing this process with just a normal df.apply()
works fine.
Running on Ubuntu 20.04, Python 3.8, Pandarallel 1.5.1.
@MLTQ Tried using this?
word_vecs = raw_text.parallel_apply(get_vecs, w2v_model=w2v_model)
and reinitialize get_vecs to :
def get_vecs(sentence, w2v_model=None):