Error when setting up bayesian optimizer with asha scheduler

I’m getting type errors when trying to set up a bayesian optimizer and asha scheduler for hyperparameter tuning with RLlib.

relevant code:

Bayesian optimizer for hyperparameters

search_alg = BayesOptSearch(metric=“mean_loss”, mode=“min”)
bayesopt = ConcurrencyLimiter(search_alg, max_concurrent=2)

Asha Scheduler

asha_scheduler = ASHAScheduler(
time_attr=‘training_iteration’,
metric=‘episode_reward_mean’,
mode=‘max’,
max_t=100,
grace_period=10,
reduction_factor=3,
brackets=1)

run experiment

ray.init()
analysis = tune.run(ppo.PPOTrainer, config=config, stop=stop_dict, local_dir=output_dir,
checkpoint_freq=checkpoint_freq, checkpoint_at_end=True, name=expr_name, scheduler=asha_scheduler, search_alg=bayesopt)
print("Best hyperparameters found were: ", analysis.best_config)

This is the relevant error I think, it’s not letting me copy the full traceback.

TypeError: Failed to convert object of type <class ‘ray.tune.sample.Float’> to Tensor. Contents: <ray.tune.sample.Float object at 0x7fc45de98210>. Consider casting elements to a supported type.

python 3.7.10
ray 1.5.2
tensorflow 2.6

Can you post your config dict? The error message indicates a misconfiguration of the search space/config parameters.