microsoft / FLAML

A fast library for AutoML and tuning. Join our Discord: https://discord.gg/Cppx2vSPVP.
https://microsoft.github.io/FLAML/
MIT License
3.91k stars 508 forks source link

AutoML classification on Ray failed with error #256

Closed konabuta closed 3 years ago

konabuta commented 3 years ago

HI I'm trying to run AutoML Classification on Ray, but failed with the following error.

Traceback (most recent call last):
  File "test.py", line 11, in <module>
    x = automl.fit(X,y,time_budget=10, task='classification', n_concurrent_trials=2)
  File "/anaconda/envs/ray/lib/python3.6/site-packages/flaml/automl.py", line 1567, in fit
    self._search()
  File "/anaconda/envs/ray/lib/python3.6/site-packages/flaml/automl.py", line 2064, in _search
    self._search_parallel()
  File "/anaconda/envs/ray/lib/python3.6/site-packages/flaml/automl.py", line 1680, in _search_parallel
    verbose=self.verbose,
  File "/anaconda/envs/ray/lib/python3.6/site-packages/ray/tune/tune.py", line 532, in run
    runner.step()
  File "/anaconda/envs/ray/lib/python3.6/site-packages/ray/tune/trial_runner.py", line 510, in step
    next_trial = self._get_next_trial()  # blocking
  File "/anaconda/envs/ray/lib/python3.6/site-packages/ray/tune/trial_runner.py", line 654, in _get_next_trial
    self._update_trial_queue(blocking=wait_for_trial)
  File "/anaconda/envs/ray/lib/python3.6/site-packages/ray/tune/trial_runner.py", line 1117, in _update_trial_queue
    trial = self._search_alg.next_trial()
  File "/anaconda/envs/ray/lib/python3.6/site-packages/ray/tune/suggest/search_generator.py", line 88, in next_trial
    self._experiment.dir_name)
  File "/anaconda/envs/ray/lib/python3.6/site-packages/ray/tune/suggest/search_generator.py", line 95, in create_trial_if_possible
    suggested_config = self.searcher.suggest(trial_id)
  File "/anaconda/envs/ray/lib/python3.6/site-packages/ray/tune/suggest/suggestion.py", line 392, in suggest
    suggestion = self.searcher.suggest(trial_id)
  File "/anaconda/envs/ray/lib/python3.6/site-packages/flaml/searcher/blendsearch.py", line 727, in suggest
    init_config, self._ls_bound_min, self._ls_bound_max
  File "/anaconda/envs/ray/lib/python3.6/site-packages/flaml/searcher/flow2.py", line 252, in complete_config
    partial_config, self.space, self, disturb, lower, upper
  File "/anaconda/envs/ray/lib/python3.6/site-packages/flaml/tune/space.py", line 511, in complete_config
    domain.categories[index],
TypeError: list indices must be integers or slices, not NoneType

This problem seems to happen on only classification task. Code is very simple.

from sklearn.datasets import *
from flaml import AutoML
import ray

if __name__ == "__main__":
    ray.init()

    X,y = make_classification(1000,10)

    automl = AutoML()
    x = automl.fit(X,y,time_budget=10, task='classification', n_concurrent_trials=2)
sonichi commented 3 years ago

Thanks for finding the bug. Working on a fix.