python - DEAP and Multiprocessing: Passing Toolbox between Modules -


i wrote algorithm deap , wish wrap inside app pyqt. set , registered evolutionary operators in controller module , tried run algorithm gui noticed when pass toolbox multiprocessing pool sort of disappears toolbox , can't use inside algorithm module. declared pool inside main guard in controller so:

if __name__ == '__main__': pool = multiprocessing.pool() toolbox.register("map", pool.map) main() 

and have toolbox global variable in controller module too. when button clicked pass toolbox function inside algorithm's module , that's seem lose reference pool?

i tried setting pool once algorithm's start function called picklable error saying class not same object. there way launch pool module , pass another? or there way of achieving desired effect?

thank you.


Comments

Popular posts from this blog

angular - DownloadURL return null in below code -

meteor - inserting data to database gives error "insert failed: Method '/texts/insert' not found" -