rsteca / sklearn-deap

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

njobs > 1 throws error AttributeError: Can't get attribute 'Individual' on <module 'deap.creator' from '\\site-packages\\deap\\creator.py'> #70

Closed driscoll42 closed 3 years ago

driscoll42 commented 3 years ago

Whenever I set njobs > 1 I get the errors, copied below. When njobs = 1, it works fine, but without njobs > 1 it's not much better than GridSearchCV.

`Process SpawnPoolWorker-19: Traceback (most recent call last): File "\lib\multiprocessing\process.py", line 258, in _bootstrap self.run() File "\lib\multiprocessing\process.py", line 93, in run self._target(*self._args, **self._kwargs) File "\lib\multiprocessing\pool.py", line 108, in worker task = get() File "\lib\multiprocessing\queues.py", line 337, in get return _ForkingPickler.loads(res) AttributeError: Can't get attribute 'Individual' on <module 'deap.creator' from lib\site-packages\deap\creator.py'> C:\Users\mdriscoll6\Anaconda3\envs\CSE6250-BD4H-3.6\lib\site-packages\sklearn\utils\deprecation.py:143: FutureWarning: The sklearn.metrics.scorer module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.metrics. Anything that cannot be imported from sklearn.metrics is now part of the private API. warnings.warn(message, FutureWarning) \lib\site-packages\sklearn\utils\deprecation.py:143: FutureWarning: The sklearn.metrics.scorer module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.metrics. Anything that cannot be imported from sklearn.metrics is now part of the private API. warnings.warn(message, FutureWarning) \lib\site-packages\sklearn\utils\deprecation.py:143: FutureWarning: The sklearn.metrics.scorer module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.metrics. Anything that cannot be imported from sklearn.metrics is now part of the private API. warnings.warn(message, FutureWarning) lib\site-packages\sklearn\utils\deprecation.py:143: FutureWarning: The sklearn.metrics.scorer module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.metrics. Anything that cannot be imported from sklearn.metrics is now part of the private API. warnings.warn(message, FutureWarning) lib\site-packages\sklearn\utils\deprecation.py:143: FutureWarning: The sklearn.metrics.scorer module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.metrics. Anything that cannot be imported from sklearn.metrics is now part of the private API. warnings.warn(message, FutureWarning)

Process finished with exit code -1 `

rsteca commented 3 years ago

Hi @driscoll42 ! I suggest you to check out issue #59 . It seems to be a problem of the deap library on Windows. Not much I can do.