Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more..
    Dismiss Notice
  3. Dismiss Notice

SAC freeze when working with demonstration

Discussion in 'ML-Agents' started by Wolf00007, Jul 30, 2021.

  1. Wolf00007

    Wolf00007

    Joined:
    Jan 26, 2019
    Posts:
    24
    Hello,
    I'm having a problem with SAC training but only when I'm working with behavioral cloning. Normal SAC training takes 25-30 minutes to finish while SAC with BC freezes for a long time, then unfreezes to continue but the whole thing lasts around 3 hours. I noticed it's the environment that is freezing and not responding.

    It is not related to my hardware as Unity and python use not too many resources in my example. I'm working with the PushBlock example by the way (32 agents on the scene). I did not have such problems before. Could this be because of a large demo file I have prepared (around 25,000 steps)? Or should I use some special parameters when running training?

    Here is the config file I'm using:

    upload_2021-7-30_18-41-54.png

    What can I do to prevent the freezing of the environment?
     
  2. ruoping_unity

    ruoping_unity

    Unity Technologies

    Joined:
    Jul 10, 2020
    Posts:
    134
    Behavioral cloning will introduce an extra update which contribute to longer training time, but usually it's not that long. I saw that in your config file you're using `samples_per_update = 0`, which means use all the samples in the demo. This is effectively having a batch size of 25000 that caused your training to slow down a lot.
    Modify samples_per_update to some reasonable batch size or use smaller demos should help speed up your training.
     
  3. Wolf00007

    Wolf00007

    Joined:
    Jan 26, 2019
    Posts:
    24
    @ruoping_unity Thank you for your reply. I still don't really understand why the environment would freeze for so long, even though it is not using almost any of my computer's resources. Or are the freezes expected with that kind of setup nonetheless?