4

Hi I am trying to do my first unity ml-agents ai. Before, when I wanted to train my ai, I was writing

mlagents-learn config/trainer_config.yaml --run-id=Taxi-1 --train

in the terminal, but the ai stopped training after 50 000 steps. Then, I tried to train it again, with another

mlagents-learn config/trainer_config.yaml --run-id=Taxi-1 --train

Then, I saw that you had to add --load to the command if you wanted it not to start over the whole training and to continue training your previous model. However, when I write

mlagents-learn config/trainer_config.yaml --load --run-id=Taxi-1 --train

It only does one step and then stops. This is what it writes in the terminal:

INFO:mlagents.trainers:{'--curriculum': 'None',
 '--docker-target-name': 'None',
 '--env': 'None',
 '--help': False,
 '--keep-checkpoints': '5',
 '--lesson': '0',
 '--load': True,
 '--no-graphics': False,
 '--num-runs': '1',
 '--run-id': 'Taxi-1',
 '--save-freq': '50000',
 '--seed': '-1',
 '--slow': False,
 '--train': True,
 '--worker-id': '0',
 '<trainer-config-path>': 'config/trainer_config.yaml'}
INFO:mlagents.envs:Start training by pressing the Play button in the 
Unity Editor.
INFO:mlagents.envs:
'Academy' started successfully!
Unity Academy name: Academy
    Number of Brains: 2
    Number of Training Brains : 1
    Reset Parameters :

Unity brain name: CarLBrain
    Number of Visual Observations (per agent): 0
    Vector Observation space size (per agent): 12
    Number of stacked Vector Observation: 6
    Vector Action space type: continuous
    Vector Action space size (per agent): [2]
    Vector Action descriptions: , 
Unity brain name: CarPBrain
    Number of Visual Observations (per agent): 0
    Vector Observation space size (per agent): 12
    Number of stacked Vector Observation: 6
    Vector Action space type: discrete
    Vector Action space size (per agent): [10, 10]
    Vector Action descriptions: , 
INFO:mlagents.trainers:Loading Model for brain CarLBrain
INFO:tensorflow:Restoring parameters from ./models/Taxi-1- 
   0/CarLBrain/model-50001.cptk
   INFO:mlagents.envs:Hyperparameters for the PPO Trainer of brain 
   CarLBrain: 
batch_size: 1024
beta:   0.005
buffer_size:    10240
epsilon:    0.2
gamma:  0.99
hidden_units:   128
lambd:  0.95
learning_rate:  0.0003
max_steps:  5.0e4
normalize:  False
num_epoch:  3
num_layers: 2
time_horizon:   64
sequence_length:    64
summary_freq:   1000
use_recurrent:  False
summary_path:   ./summaries/Taxi-1-0_CarLBrain
memory_size:    256
use_curiosity:  False
curiosity_strength: 0.01
curiosity_enc_size: 128
model_path: ./models/Taxi-1-0/CarLBrain
INFO:mlagents.envs:Saved Model
INFO:mlagents.trainers:List of nodes to export for brain :CarLBrain
INFO:mlagents.trainers: is_continuous_control
INFO:mlagents.trainers: version_number
INFO:mlagents.trainers: memory_size
INFO:mlagents.trainers: action_output_shape
INFO:mlagents.trainers: action
INFO:mlagents.trainers: action_probs
INFO:mlagents.trainers: value_estimate
INFO:tensorflow:Restoring parameters from ./models/Taxi-1- 
0/CarLBrain/model-50002.cptk
INFO:tensorflow:Froze 17 variables.
Converted 17 variables to const ops.

Do you know how I can continue my training to more than 50 000 steps? Thank you for your help! Don't hesitate to ask for any clarification.

Vincent Quirion
  • 389
  • 2
  • 4
  • 16
  • 3
    Try to increase the ¨max_steps¨ parameter in the config/trainer_config.yaml file. Currently, it is set to 5.0e4 which means 50000, so if you set it to 5.0e6 for example then it should run for 5000000 times before stopping – Michael Glazunov Jan 29 '19 at 08:47
  • @MichaelGlazunov it worked thank you! – Vincent Quirion Jan 29 '19 at 11:20

0 Answers0