Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

How to setup Unity ML Agents with Python and run an executable?

Discussion in 'ML-Agents' started by mannatant, Mar 3, 2020.

  1. mannatant

    mannatant

    Joined:
    Mar 3, 2020
    Posts:
    4
    Newbie here, i have wasted lots of hours trying to setup Unity Mlagents with Python.
    Basically, i just want to peroperly install mlagents package in python which are : ml-agents and ml-agents-envs as given in the docs : https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Installation.md
    It does seems to be much reliable. I want to be able to create custom environments and for that ,as per the docs, manual pip3 installation is needed.
    I am trying to do this in Ubuntu.
    For confirming proper installation, it says to run this specific command : mlagents-learn in terminal. If Unity logo shows up then its all ok else something's wrong. In my case, the logo dosen't comes up.
    At first few tries it was showing some errors related to Tensorflow like module not found, name 'abs' not found, attribute __version__ not found etc. Then after some "tweaking" , the command : mlagents-learn , to check valididty of the installation, was not even working ('command not found').
    The problems which are bothering me are :
    1. Intsallation of compatible version of Tensorflow.
    2. Intsallation of compatible version of ml-agents-env
    2. Installation of numpy. I know that numpy is already supposed to be present as a module in base python but here some ambiguity arises between the global python env and the anaconda environment as installtion of packages is done via pip here. This problem arises when I try to run (maybe the 3rd cell?) of this introductory Jupyter notebook : https://github.com/Unity-Technologies/ml-agents/blob/master/notebooks/getting-started.ipynb.

    Can someone help me by giving step by step instructions to setup Unity mlagents with Python using anaconda environments ? And if possible, also running an executable in the Jupyter notebook?

    PS : I am using the version of mlagents which is directly cloned form master.
     
  2. ascrawfo

    ascrawfo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    4
    Hello mannatant, what version of python are you using? Does it happen to be 3.8? I know Tensorflow doesn't actually have a pip package for that specific version yet
     
  3. mannatant

    mannatant

    Joined:
    Mar 3, 2020
    Posts:
    4