You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using ray.tune.sample_from with BayesOptSearch and points_to_evaluate parameter. Causes the dictionary values to be indexed, which isn't possible for non-indexable values. Expected behavior is to be able to specify starting values for the algorithm, along with using sample_from to sample parameters, e.g., when creating samples depending on another value.
Error message I get: TypeError: 'int' object is not subscriptable
Versions / Dependencies
Ray version: 2.22.0
Python version: 3.9.2
OS: Debian GNU/Linux 11.9
from ray import tune, train as ray_train
from ray.train import Checkpoint, RunConfig, CheckpointConfig
from ray.tune.search.bayesopt import BayesOptSearch
def objective(config):
return {"score": 1}
initial_params = [{"a": 1}]
search_space = {"a": tune.sample_from(lambda: 2)}
# Using the following search_space, would work
# search_space = {"a": 2}
bayesopt = BayesOptSearch(points_to_evaluate=initial_params)
tuner = tune.Tuner(
objective,
param_space=search_space,
tune_config=tune.TuneConfig(
metric="score", mode="max", search_alg=bayesopt
),
)
tuner.fit()
Issue Severity
Medium
The text was updated successfully, but these errors were encountered:
Paippi
added
bug
Something that is supposed to be working; but isn't
triage
Needs triage (eg: priority, bug/not-bug, and owning component)
labels
May 17, 2024
hongpeng-guo
added
P2
Important issue, but not time-critical
and removed
triage
Needs triage (eg: priority, bug/not-bug, and owning component)
labels
May 28, 2024
What happened + What you expected to happen
Using
ray.tune.sample_from
withBayesOptSearch
andpoints_to_evaluate
parameter. Causes the dictionary values to be indexed, which isn't possible for non-indexable values. Expected behavior is to be able to specify starting values for the algorithm, along with usingsample_from
to sample parameters, e.g., when creating samples depending on another value.Error message I get: TypeError: 'int' object is not subscriptable
Versions / Dependencies
Ray version: 2.22.0
Python version: 3.9.2
OS: Debian GNU/Linux 11.9
Other libraries:
Reproduction script
Issue Severity
Medium
The text was updated successfully, but these errors were encountered: