Question regarding multiprocessing and error: Can't pickle <type

T

tleeuwenburg

Hi all,

Thanks in advance for any suggestions. I'm getting the following:

Exception in thread Thread-1:
Traceback (most recent call last):
File "/work/tjl/apps/lib/python2.6/threading.py", line 525, in
__bootstrap_inner
self.run()
File "/work/tjl/apps/lib/python2.6/threading.py", line 477, in run
self.__target(*self.__args, **self.__kwargs)
File "/work/tjl/apps/lib/python2.6/multiprocessing/pool.py", line
225, in _handle_tasks
put(task)
PicklingError: Can't pickle <type 'instancemethod'>: attribute lookup
__builtin__.instancemethod failed


The code block which calls this is:


def processGrids(self, grids):
'''
Get each grid within the time range and initiate processing
for each grid
'''

numberOfGrids = float(len(grids))


import multiprocessing, functools
pool = multiprocessing.Pool(processes=2)

pool.map(self.processSingleGrid, [(grid, index, grids) for
index, grid in enumerate(grids)])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top