Search Unity

Question Run multiple trainings each for different game in parrallel

Discussion in 'ML-Agents' started by Ordpers, Feb 11, 2023.

  1. Ordpers

    Ordpers

    Joined:
    Aug 10, 2019
    Posts:
    6
    I want to run two different trainings (game is different) in parrallel. What is the best way to do it? I tried running but it gives error that "address already in use". I tried changing base port, but it gives error "pipe is broken".
     
  2. hughperkins

    hughperkins

    Joined:
    Dec 3, 2022
    Posts:
    191
    Backing up in step, I'm unclear whether it's faster to run multiple training runs in parallel, rather than to just use multiple unity instances to accelerate one training run, and then run the training runs sequentially?

    That said, you should be able to simply change the base port. However, there are a few conditions:
    - you need to be running your game using a standalone server build, not in the editor
    - you need to pass the path of the standalone server build when running mlagents
    - you need to make sure the base port ranges do not overlap
    --- for example, if you are using 4 unity instances for run 1, and 4 for run 2, then the base port for run 1 should be at least 4 ports away from the base port for run 2
     
  3. hughperkins

    hughperkins

    Joined:
    Dec 3, 2022
    Posts:
    191
  4. Ordpers

    Ordpers

    Joined:
    Aug 10, 2019
    Posts:
    6
    Thank you. It turns out the problem was with permissions. I run chmod, and now it is working. I also changed port as you suggested
     
    hughperkins likes this.
  5. hughperkins

    hughperkins

    Joined:
    Dec 3, 2022
    Posts:
    191