Hi all,
I’m testing out ml-agents for the first time. I seem to have the installed the system correctly from what I can tell. Running the 3DBall scene according to the Getting Started guide (ml-agents/docs/Getting-Started.md at main · Unity-Technologies/ml-agents · GitHub) works just fine. Then, running the first training command, as instructed, I get an error that I can’t figure out (pasted below). The error suggests that the 3DBall.yaml file needs to have a brain name specified. I haven’t touched the default 3DBall.yaml file. It also says, unhelpfully, to refer to the config/trainer_config.yaml file. But that file does not exist in the downloaded repository. Does anyone know how to resolve this, or why this would be happening? Thank you!
Here is the terminal error (Unity ASCII art removed):
zachDuerMacBook:ml-agents zach$ mlagents-learn config/ppo/3DBall.yaml --run-id=first3DBallRun --force
Version information:
ml-agents: 0.16.0,
ml-agents-envs: 0.16.0,
Communicator API: 1.0.0,
TensorFlow: 1.12.0
2020-05-03 19:31:39 INFO [environment.py:201] Listening on port 5004. Start training by pressing the Play button in the Unity Editor.
2020-05-03 19:31:44 INFO [environment.py:111] Connected to Unity environment with package version 1.0.0-preview and communication version 1.0.0
2020-05-03 19:31:44 INFO [environment.py:342] Connected new brain:
3DBall?team=0
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mlagents/trainers/trainer_controller.py”, line 175, in _create_trainer_and_manager
trainer = self.trainers[brain_name]
KeyError: ‘3DBall’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.6/bin/mlagents-learn”, line 11, in
sys.exit(main())
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mlagents/trainers/learn.py”, line 554, in main
run_cli(parse_command_line())
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mlagents/trainers/learn.py”, line 550, in run_cli
run_training(run_seed, options)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mlagents/trainers/learn.py”, line 407, in run_training
tc.start_learning(env_manager)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mlagents_envs/timers.py”, line 305, in wrapped
return func(*args, **kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mlagents/trainers/trainer_controller.py”, line 227, in start_learning
self._create_trainers_and_managers(env_manager, new_behavior_ids)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mlagents/trainers/trainer_controller.py”, line 213, in _create_trainers_and_managers
self._create_trainer_and_manager(env_manager, behavior_id)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mlagents/trainers/trainer_controller.py”, line 177, in _create_trainer_and_manager
trainer = self.trainer_factory.generate(brain_name)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mlagents/trainers/trainer_util.py”, line 61, in generate
self.multi_gpu,
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mlagents/trainers/trainer_util.py”, line 100, in initialize_trainer
f’Trainer config must have either a “default” section, or a section for the brain name ({brain_name}). ’
mlagents.trainers.exception.TrainerConfigError: Trainer config must have either a “default” section, or a section for the brain name (3DBall). See config/trainer_config.yaml for an example.
AND here is the 3DBall.yaml file contents:
behaviors:
3DBall:
trainer: ppo
batch_size: 64
beta: 0.001
buffer_size: 12000
epsilon: 0.2
hidden_units: 128
lambd: 0.99
learning_rate: 0.0003
learning_rate_schedule: linear
max_steps: 5.0e5
memory_size: 128
normalize: true
num_epoch: 3
num_layers: 2
time_horizon: 1000
sequence_length: 64
summary_freq: 12000
use_recurrent: false
vis_encode_type: simple
reward_signals:
extrinsic:
strength: 1.0
gamma: 0.99