I have an environment with 6 identical agents which interact with each other. (This problem also occurs when I only have 1 agent.) Training with PPO and the below config file works as expected, performing around 30k steps in less than a minute.
behaviors:
CarAgent:
trainer_type: ppo
hyperparameters:
batch_size: 2048
buffer_size: 20480
learning_rate: 0.0003
beta: 0.005
epsilon: 0.2
lambd: 0.95
num_epoch: 3
learning_rate_schedule: linear
network_settings:
normalize: true
hidden_units: 512
num_layers: 3
vis_encode_type: simple
reward_signals:
extrinsic:
gamma: 0.995
strength: 1.0
keep_checkpoints: 5
max_steps: 30000000
time_horizon: 1000
summary_freq: 30000
threaded: true
Using the same exact environment with the below config file using SAC and its relevant hyper parameters, freezes the environment as is able to compute 30k steps in around 45 minutes to 1.5 hours.
behaviors:
CarAgent:
trainer_type: sac
hyperparameters:
batch_size: 2048
buffer_size: 20480
learning_rate: 0.0003
learning_rate_schedule: linear
buffer_init_steps: 0
tau: 0.005
steps_per_update: 20.0
save_replay_buffer: false
init_entcoef: 0.5
reward_signal_steps_per_update: 10.0
network_settings:
normalize: true
hidden_units: 512
num_layers: 3
vis_encode_type: simple
reward_signals:
extrinsic:
gamma: 0.995
strength: 1.0
keep_checkpoints: 5
max_steps: 30000000
time_horizon: 1000
summary_freq: 30000
threaded: true
I also tried the suggestions posted in SAC long train time on 12 cores AMD 5900X , running with, --tensorflow, changing cpu_utils,py and increasing the batch_size and steps_per_update, with no improvement.
I am also trying to create my own RL using the python API and again training time is very slow when compared to the PPO.
I am using the following command to start training from the CMD
mlagents-learn config_sac.yaml --run-id=SAC --env="....\FinalEnv\Build" --time-scale=10 --quality-level=0 --width=640 --height=640 --force
The below are a few more details.
Version information:
ml-agents: 0.23.0,
ml-agents-envs: 0.23.0,
Communicator API: 1.3.0,
PyTorch: 1.7.0+cu110
If found this issue as well but not sure what they mean by the inference configuration.(python - Unity ML-Agents Running Very Slowly - Stack Overflow) (Just including this for completeness, and maybe its a possible solution)
Any help would be appreciated.
Thank you in advance.