ML Agents Google Colab Virtual Display

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:

Thank you in advance.

We’ll forward this to the team for you, @AntonOhammar - which version of C# & Python are you using?

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.

Hi @AntonOhammar
I got the same error. Did you solve this problem?

Hi! No unfortunately not. I’ve tried many different tips, but can’t get it to work.

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