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)])
 
Ad

Advertisements


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

Top