Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Question regarding multiprocessing and error: Can't pickle <type (http://www.velocityreviews.com/forums/t701507-question-regarding-multiprocessing-and-error-cant-pickle-type.html)

tleeuwenburg@gmail.com 10-14-2009 02:41 AM

Question regarding multiprocessing and error: Can't pickle <type
 
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)])


Tennessee 10-14-2009 05:11 AM

Re: Question regarding multiprocessing and error: Can't pickle <type
 
I have found a way around my problem.

-Tennessee


All times are GMT. The time now is 05:30 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57