Hello there,
I am new to Unity, and I am trying to train an RL agent using the Karting Mod: Smart Karts Training Guide. However, I am using mlagents==0.24.1 in place of 0.12.0 and python 3.8.5. My system runs Ubuntu 20.04 LTS and CUDA 11.0.
I have converted the config file to the new standard and when I run:
mlagents-learn Assets/Karting/Prefabs/AI/kart_mg_trainer_new-config.yaml --run-id=WindingTrack_ppo_1
I get the following error message.
Version information:
ml-agents: 0.24.1,
ml-agents-envs: 0.24.1,
Communicator API: 1.4.0,
PyTorch: 1.7.1
2021-03-11 18:46:02 INFO [learn.py:245] run_seed set to 7706
2021-03-11 18:46:02 INFO [torch.py:58] default Torch device: cuda
2021-03-11 18:46:02 INFO [environment.py:207] Listening on port 5004. Start training by pressing the Play button in the Unity Editor.
2021-03-11 18:46:07 INFO [environment.py:111] Connected to Unity environment with package version 1.0.7 and communication version 1.0.0
2021-03-11 18:46:17 INFO [environment.py:279] Connected new brain:
ArcadeDriver?team=0
2021-03-11 18:46:17 INFO [stats.py:182] Hyperparameters for behavior name ArcadeDriver:
trainer_type: ppo
hyperparameters:
batch_size: 512
buffer_size: 10240
learning_rate: 0.0002
beta: 0.005
epsilon: 0.2
lambd: 0.95
num_epoch: 3
learning_rate_schedule: linear
network_settings:
normalize: False
hidden_units: 128
num_layers: 2
vis_encode_type: simple
memory: None
reward_signals:
extrinsic:
gamma: 0.99
strength: 1.0
init_path: None
keep_checkpoints: 5
checkpoint_interval: 500000
max_steps: 50000000000
time_horizon: 64
summary_freq: 1000
threaded: True
self_play: None
behavioral_cloning: None
2021-03-11 18:47:21 INFO [subprocess_env_manager.py:220] UnityEnvironment worker 0: environment stopping.
2021-03-11 18:47:21 INFO [model_serialization.py:130] Converting to results/WindingTrack_ppo_1/ArcadeDriver/ArcadeDriver-0.onnx
2021-03-11 18:47:21 INFO [model_serialization.py:142] Exported results/WindingTrack_ppo_1/ArcadeDriver/ArcadeDriver-0.onnx
2021-03-11 18:47:21 INFO [torch_model_saver.py:116] Copied results/WindingTrack_ppo_1/ArcadeDriver/ArcadeDriver-0.onnx to results/WindingTrack_ppo_1/ArcadeDriver.onnx.
2021-03-11 18:47:21 INFO [trainer_controller.py:81] Saved Model
Traceback (most recent call last):
File "/Project/Unity_Kart_ML/venv/bin/mlagents-learn", line 8, in <module>
sys.exit(main())
File "/Project/Unity_Kart_ML/venv/lib/python3.8/site-packages/mlagents/trainers/learn.py", line 250, in main
run_cli(parse_command_line())
File "/Project/Unity_Kart_ML/venv/lib/python3.8/site-packages/mlagents/trainers/learn.py", line 246, in run_cli
run_training(run_seed, options)
File "/Project/Unity_Kart_ML/venv/lib/python3.8/site-packages/mlagents/trainers/learn.py", line 125, in run_training
tc.start_learning(env_manager)
File "/Project/Unity_Kart_ML/venv/lib/python3.8/site-packages/mlagents_envs/timers.py", line 305, in wrapped
return func(*args, **kwargs)
File "/Project/Unity_Kart_ML/venv/lib/python3.8/site-packages/mlagents/trainers/trainer_controller.py", line 175, in start_learning
n_steps = self.advance(env_manager)
File "/Project/Unity_Kart_ML/venv/lib/python3.8/site-packages/mlagents_envs/timers.py", line 305, in wrapped
return func(*args, **kwargs)
File "/Project/Unity_Kart_ML/venv/lib/python3.8/site-packages/mlagents/trainers/trainer_controller.py", line 233, in advance
new_step_infos = env_manager.get_steps()
File "/Project/Unity_Kart_ML/venv/lib/python3.8/site-packages/mlagents/trainers/env_manager.py", line 124, in get_steps
new_step_infos = self._step()
File "/Project/Unity_Kart_ML/venv/lib/python3.8/site-packages/mlagents/trainers/subprocess_env_manager.py", line 310, in _step
raise env_exception
mlagents_envs.exception.UnityTimeOutException: The Unity environment took too long to respond. Make sure that :
The environment does not need user interaction to launch
The Agents' Behavior Parameters > Behavior Type is set to "Default"
The environment and the Python interface have compatible versions.
I noted the while mlagetns-learn is listening on port 5004 ./venv/lib/python3.8/site-packages/mlagents_envs/communicator.py is listening on port 5005. I change this last to 5004, but the issue persisted.