science_concierge
science_concierge copied to clipboard
Can't pickle <type 'instancemethod'> when using python's multiprocessing Pool.map()
Good catch! I think I had the same error once. When does this happen?
When using python 2.7. People in Stack Overflow suggested to use pathos.
I would go with pathos. Where are you getting the error? Can you share code to reproduce the error?
Here is code that gives error. Note that I do a quick fix in 50f7019ee844a65719a1
from science_concierge import preprocess
from multiprocessing import Pool
df = pd.read_csv('pubmed_oa_2016.csv')
docs = list(df.abstract)
pool = Pool()
docs_preprocess = pool.map(preprocess, docs)
This error is gone after I installed pathos i.e.
pip install git+https://github.com/uqfoundation/pathos.git@master