I managed to install Unity ML-Agents in the past as the documentation was slightly more detailed, with a table showing what versions to use for the unity package and python package.
The getting started and installation guide really does take you all over the place.
It seems simple enough:
Install the verified ML Agents package from Unity
Clone the repository from branch 18 if you want to use the example environments
pip install relevant ML-Agents and Pytorch package at the correct python version in a conda environment.
After this I am faced with countless complier issues. Iâm not positing the details of the error cause I can figure it out and install it myself, but it shouldnât be this complicated!
The getting started guide or installation guide should mention the version of python, python package and Unity package for the current up to date successful install in one document.
Please could someone tell me the following:
Version of MLAgents to install from package registry
What repo branch to clone for this version
I will use this repo to install the extra . extensions package
version of python + Pytorch and MLagents
I really love what your trying to achieve here and I know these things take time. Ideally the installation guide and installation itself is simplified as soon as possible.
Thanks,
Hereâs what worked for me recently on Windows and Mac OS, using Conda:
Created and activated Conda environment with Python 3.7 pip install mlagents (did install version 0.27.0 and dependencies incl. PyTorch on Mac, but PyTorch needs to be installed prior to ML-Agents on Windows)
There is a table on this website which indicated which files and unity packages to install.
I followed the row for release 18 since this is the one called âstableâ and to get started with.
I downloaded the repo through this webpage (release_18), and also tried cloning the release 18 branch when I faced errors
I installed the MLAgents package 2.1.0 and the the .extensions from the cloned repo (advanced installation steps) into unity package manager.
I pip installed pytorch 1.7.1 and python package ml-agents =0.27.0
This is 2 of 32 errors seen:
Assets\ML-Agents\Examples\PushBlockWithInput\Scripts\PushBlockActions.cs(15,19): error CS0234: The type or namespace name âInputSystemâ does not exist in the namespace âUnityEngineâ (are you missing an assembly reference?)
Assets\ML-Agents\Examples\PushBlockWithInput\Scripts\PushBlockWithInputPlayerController.cs(54,26): error CS0246: The type or namespace name âInputActionâ could not be found (are you missing a using directive or an assembly reference?)
This looks like a common problem mentioned by others online on Youtube and stackoverflow, but I would think the issue is solved within the repo considering it is the latest stable version?
I donât think itâs to do with python /Pytorch /MLAgents version installed in conda as I havenât used them.
Itâs more related to the cloned repo, and the version of Unity MLAgents (and extension) installed into Unity.
I hope this makes sense. I really donât want to invest to much time with a significantly older version and this open source library is really amazing, I just want to get started as soon as possible.
From the package manager (advanced installation), I install the MLAgents and .extentions Unity Package from the same repository.
I drag and drop the folders from Project into Unity, and see a ton of complier errors:
Assets\ML-Agents\Examples\PushBlockWithInput\Scripts\PushBlockWithInputPlayerController.cs(54,26): error CS0246: The type or namespace name âInputActionâ could not be found (are you missing a using directive or an assembly reference?)
The manifest is great to show all the different versions, but I have followed the installation of the correct versions from their docs.
Firstly just want to say thank you for all your help.
Basically, the main error was related to one specific game environment. I just decided to delete that entire environment.
When you said âerror with demo projectâ it made me realize MLAgents is working fine, itâs just not working for one specific demo (example environment). I deleted that game PushBlockWithInputPlayerController.cs and everything looks fine.
I come from a Machine Learning background in Python (with some experience in OpenAI gym). I have only started learning how to create games now, so I can make more use out of MLAgents.
I can finally begin MLAgents journey properly.
Level 1) Use example environment, see if you can change some parameters to improve training
Level 2) Create your own game, or adjust the reward structure of the current example games to see if I can improve training.
If you have any recommendations or tips please let me know.
I totally agree, the information on the github site is all over the place and to just find the right site with the current releases, I had to google it bc otherwise I could not find it.
Anyway, my superb expert tip is: Watch the CodeMonkey setup video. Always works with his video.
I am really tired, tried six different tutorial, read the documentation and I still have the same issue.
No damn example is showing in the assets.
Please someone clarifies what I am doing wrong.
Opened a new Project
Install ML agents from package manager
Download package extension
Through package manager install package from file>select phe package.json and this should be it (of course the virtual environment, pythorch)
I created an end to end tutorial on medium that should help:
Screenshots included.
To summarize, after installing the ml-agents package, and extentions, you should clone the MLAgents repo from github and open it in Unity. Navigate to any of the games scene folder and open those.
Fighting with them rocket science since a few hours and at least got the samples to compile and work.
Point is you need to copy everything from repo (ml-agents/Project/Assets) into your Assets folder