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
467 stars 51 forks source link

Fail to run the conda installed tune_sklearn package #261

Open Soga-no-Tojiko opened 1 year ago

Soga-no-Tojiko commented 1 year ago

I am running my scripts in a Python 3.9.13 environment through Anaconda VScode. The package was downloaded via Anaconda Prompt by 'conda install -c conda-forge tune-sklearn'. The download was successful but I failed to import it. The error messages are as follows.

P.S. windows system


ImportError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_19684\1695006636.py in ----> 1 import tune_sklearn as tune 2 3

d:\Anaconda3\lib\site-packages\tune_sklearn__init.py in ----> 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__"]

d:\Anaconda3\lib\site-packages\tune_sklearn\tune_gridsearch.py in 13 check_is_pipeline, check_error_warm_start, 14 is_tune_grid_search, MaximumIterationStopper) ---> 15 from tune_sklearn.tune_basesearch import TuneBaseSearchCV 16 from tune_sklearn._trainable import _Trainable 17 from tune_sklearn._trainable import _PipelineTrainable

d:\Anaconda3\lib\site-packages\tune_sklearn\tune_basesearch.py in 36 PopulationBasedTraining, AsyncHyperBandScheduler, HyperBandScheduler, 37 MedianStoppingRule, TrialScheduler, ASHAScheduler, HyperBandForBOHB) ---> 38 from ray.tune.logger import (TBXLogger, JsonLogger, CSVLogger, MLFLowLogger, 39 Logger) 40

ImportError: cannot import name 'MLFLowLogger' from 'ray.tune.logger' (d:\Anaconda3\lib\site-packages\ray\tune\logger__init__.py)

Yard1 commented 1 year ago

I think the conda package has not been updated in a long while. I am not sure who maintains it, but it is not me. I recommend installing through pip.

Soga-no-Tojiko commented 1 year ago

I think the conda package has not been updated in a long while. I am not sure who maintains it, but it is not me. I recommend installing through pip.

Sorry for my late reply. I appreciated your help. However, I was wondering if pip will work for conda environment. A mixed usage of conda/pip have caused some problems previously.