ML Agents Training
Installation
- Install ml-agents package for python.
pip install mlagents==0.16.0
- You should also install TensorFlow.
Training
- In your ml-agents clone repositry, make sure the config yaml file exists.
- Make sure your scene is opened in the Unity Hub.
- Run the command with the target config file and id name.
mlagents-learn /media/yui/Disk/doc/ml-agents-release_2/config/trainer_config.yaml --run-id 3dball_01
- Click the play button. The training will start.
- Click the play button again to stop. It will save the model as .nn extension.
- To adjust the play speed (simulation speed). You can click tab Edit, click Project Settings, Time and Time Scale.
- To apply the new brain to the agent, drag .nn model to TFModels, click the 3d object rightarrow, press Agent, drag model to Model in Behavior Parameters.
References