UnityTimeOutException: The Unity environment took too long to respond When Using an executable

I can run training in Unity editor,it works well,but when i run training with exe, the exe can run,i can see the game window running well, but cmd can’t start train ,after a while cmd throw unityTimeOutException.So is the official example,such as 3dBall

ml-agents:1.0.2
unity:2019.3.8
tensorflow:2.2.0
python:3.8
cuda:10.2

I am quite new to mlagents. But from my experience I think this has something to do with your port. mlagents uses port 5004 for training, so if your firewall or something else block that port it won’t start training.

I had the same issue and figured it out it was due to IL2CPP. Switching the build option to Mono solved the issue for me. Hope it helps!