#ML Agents Freezes Shortly After Start

1 messages · Page 1 of 1 (latest)

rancid granite
#

I am using ML Agents package v2.0.1 to make a flappy bird AI to learn the basics before moving to other projects. The game is going and the bird is now flapping, so presumably it is going to learn at some point, but after a minute or so the Unity editor freezes. Plenty of CPU / RAM leftover, but I end up getting an error in the console and I can't even view, minimize, close the Unity editor app.

The game starts automatically when the agent is active, so I see the bird fly up a lot before the training freezes the app. The behavior type is set to default and the environment and python interface should have compatible versions. Not quite sure how to check that. And I am not running on a headless server. I've been stuck on this for weeks now without any progress or idea of where to go to solve this issue. If you need more info, please let me know.

[WARNING] Restarting worker[0] after '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.
If you're running on a headless server without graphics support, turn off display by either passing --no-graphics option or build your Unity executable as server build.'

chilly tartan
#

sounds like you have an infinite loop in your game logic

rancid granite
#

To make things easier to debug, I’ve been trying to figure out how to slow down the training process, but nothing I’ve tried has worked. How exactly is that done? I’ve tried adding a line to the yaml config and to the command line, but that doesn’t change anything. Is there a global config file that gets updated? If so, I can’t find that either. If there is looping, that’s something I can figure out when it’s slow enough to walk through

chilly tartan
#

you can set the timescale in the command line when you start training
--time-scale=1

#

default training speed is 20

rancid granite
#

I tried that but it still zooms through

#

It might have been that I didn’t keep the Unity screen open while it was running… I’m trying that now and it pauses briefly occasionally but it’s done over 20000 steps now without freezing

chilly tartan
#

you can enable 'run in background' in the settings in unity