Search Unity

How to write a python controller for an agent in a created guest unity project

Discussion in 'ML-Agents' started by yangpengzhi, Nov 29, 2021.

  1. yangpengzhi

    yangpengzhi

    Joined:
    Nov 22, 2021
    Posts:
    15
    Hi! I have built a unity environment in Ubuntu 18.04 with: https://github.com/Unity-Technologies/ml-agents/blob/main/docs/Learning-Environment-Executable.md and named it "3DBall". However, I'm not able to find the executable file as suggested. There are only a folder named "3DBall_Data" and a file named "3DBall.x86_64". And it shows that 3DBall environment couldn't be launched in Pycharm.

    Are there any suggestions about how to find the executable environment after the building process in Ubuntu? Thank you!
     
    Last edited: Nov 30, 2021
  2. hqkhan

    hqkhan

    Joined:
    Oct 19, 2021
    Posts:
    3
    Are you using the Python API? If so, something like:

    UnityEnvironment(file_name="envs/pblock_one_agent_server_demo/pblock", seed=1, log_folder='./logs')

    They say in the docs to not include the extension. So for your case, it could simply be: UnityEnvironment(file_name="3DBall_Data/3DBall") and it should work if it's compiled for Linux.
     
  3. yangpengzhi

    yangpengzhi

    Joined:
    Nov 22, 2021
    Posts:
    15
    Sorry for this late reply. Thank you! And I found in ubuntu when writing it in the absolute path, the problem could be solved.