I try to set configuration for SAC algorithm in ray.tune.
My ray tune is configured:
analysis = tune.run(
run_or_experiment=“SAC”, # check if your environment is continuous or discrete before choosing training algorithm Algorithms — Ray 3.0.0.dev0
scheduler=asha_scheduler,
stop={“episode_reward_mean”: 200}, # stop training if this value is reached
mode=‘max’, # find maximum vale as a target
config=config,
My configuration dict is:
config = {
“env”: “CartPole-v0”, # name of environment from gym library, it can be defined by user, example:
“num_gpus”: 1, #number of GPUs for trainer, remember even with GPU trainer needs 1 CPU
“num_workers”: 7, # number of workers for one trainer
“lr”: tune.grid_search([0.01, 0.001, 0.0001]), # or “lr”: tune.uniform(0.0001, 0.01)
“framework”: “tf2”, # configuration to use tensorflow 2 as a main framework# Model options for the Q network(s). "Q_model": { "fcnet_activation": "relu", "fcnet_hiddens": [256, 256], }, # Model options for the policy function. "policy_model": { "fcnet_activation": "relu", "fcnet_hiddens": [256, 256], },
}
But the error is:
When not using a state-preprocessor with SAC,
fcnet_hiddens
will be set to an empty list! Any hidden layer sizes are defined viapolicy_model.fcnet_hiddens
andQ_model.fcnet_hiddens
.
I don’t know how to solve it because hidden layers are defined in config dictionary, for PPO algorithm it worked fine.
I will be thankful for any suggestions.
Peter