Search Unity

ML Agents Google Colab Virtual Display

Discussion in 'ML-Agents' started by AntonOhammar, Feb 14, 2020.

  1. AntonOhammar

    AntonOhammar

    Joined:
    Feb 14, 2020
    Posts:
    3
    Hi.

    I have been trying to get my environment to run on google colab for a few days now. I am using visual observation and therefore can't use headless (which I have gotten to work). To get the visual observations to work I need the environment GUI to work. I can get it to work locally on a windows pc, but not on google colab. I have tried both X Server (which shouldn't work from what I understand?) and also xvfb (which should work).

    I am using Unity 2019.2.18f1 and ML Agents 0.13.1 or 0.14.0 (not sure how I check). The build is exported to Linux.

    All I get is: "The Unity environment took too long to respond."
    At line: 16 env = UnityEnv(env_name, worker_id=0, use_visual=True, uint8_visual=False)

    I have gone through almost all results I can find on google and nothing seems to work. Does anyone have any updated instructions that work for current releases and google colab?

    The notebook I have so far:
    https://colab.research.google.com/drive/1ekFKrQ3vCmM4R4SzTjlWb06wMMxGSOjl

    Thank you in advance.
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,820
    We'll forward this to the team for you, @AntonOhammar - which version of C# & Python are you using?
     
  3. AntonOhammar

    AntonOhammar

    Joined:
    Feb 14, 2020
    Posts:
    3
    Thank you so much. From what I can find I am using C# 7.3 and Python 3.7.0 on my local machine. On Google Colab they are using Python 3.6.9.

    BR, Anton.
     
  4. kvlm

    kvlm

    Joined:
    Jan 20, 2020
    Posts:
    7
    Hi @AntonOhammar
    I got the same error. Did you solve this problem?
     
  5. AntonOhammar

    AntonOhammar

    Joined:
    Feb 14, 2020
    Posts:
    3
    Hi! No unfortunately not. I've tried many different tips, but can't get it to work.
     
  6. vincentgao88

    vincentgao88

    Unity Technologies

    Joined:
    Feb 7, 2018
    Posts:
    21
    Hi AntonOhammar, I think someone had already tried this and made it work. You can refer to here: https://github.com/Unity-Technologies/ml-agents/issues/2684