rsteca / sklearn-deap

Use evolutionary algorithms instead of gridsearch in scikit-learn
MIT License
767 stars 132 forks source link

setting njobs to more than 1 doesn't work. #33

Closed ajinkyaT closed 6 years ago

rsteca commented 6 years ago

It works for me, what error are you getting?

ajinkyaT commented 6 years ago

It throws the following error in Jupyter notebook: Exception in thread Thread-6: Traceback (most recent call last): File "/home/ajinkya/anaconda3/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/home/ajinkya/anaconda3/lib/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/home/ajinkya/anaconda3/lib/python3.6/multiprocessing/pool.py", line 429, in _handle_results task = get() File "/home/ajinkya/anaconda3/lib/python3.6/multiprocessing/connection.py", line 251, in recv return _ForkingPickler.loads(buf.getbuffer()) TypeError: __init__() missing 3 required positional arguments: 'node_def', 'op', and 'message' Though njobs=1 works fine. Further I was using kerasClassifier as an estimator.

rsteca commented 6 years ago

I have never tried this in a conda environment, and another user already reported that this library might not work well using conda.

ryanpeach commented 6 years ago

I've confirmed this doesn't really work anyway, deap needs you give it a pool from within an "if name=="main"" structure for it to work (which means the user needs to do it themselves, but we can give them a param to do it).

rsteca commented 6 years ago

This should be fixed in the 0.2.2 version