ray-project / tune-sklearn

A drop-in replacement for Scikit-Learn’s GridSearchCV / RandomizedSearchCV -- but with cutting edge hyperparameter tuning techniques.
https://docs.ray.io/en/master/tune/api_docs/sklearn.html
Apache License 2.0
465 stars 52 forks source link

ImportError: cannot import name 'CombinedStopper' from 'ray.tune.stopper' #188

Closed kylegilde closed 3 years ago

kylegilde commented 3 years ago

I'm trying to import parts of the package in a Kaggle notebook, but I'm getting this import error. It's python 3.7.

Any suggestions? Thanks!

from tune_sklearn import TuneGridSearchCV
# import tune_sklearn as ts

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-11-c70cb68ac57f> in <module>
----> 1 from tune_sklearn import TuneGridSearchCV

/opt/conda/lib/python3.7/site-packages/tune_sklearn/__init__.py in <module>
----> 1 from tune_sklearn.tune_gridsearch import TuneGridSearchCV
      2 from tune_sklearn.tune_search import TuneSearchCV
      3 from tune_sklearn._version import __version__
      4 
      5 __all__ = ["TuneGridSearchCV", "TuneSearchCV", "__version__"]

/opt/conda/lib/python3.7/site-packages/tune_sklearn/tune_gridsearch.py in <module>
      5 import os
      6 
----> 7 from ray.tune.stopper import CombinedStopper
      8 from sklearn.base import clone
      9 from sklearn.model_selection import ParameterGrid

ImportError: cannot import name 'CombinedStopper' from 'ray.tune.stopper' (/opt/conda/lib/python3.7/site-packages/ray/tune/stopper.py)
kylegilde commented 3 years ago

Here is a repex: https://www.kaggle.com/kylegilde/importing?scriptVersionId=55669960

richardliaw commented 3 years ago

hey @kylegilde what version of Ray are you on? Can you make sure to upgrade to Ray 1.2?

kylegilde commented 3 years ago

That did the trick. Thanks