添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

What version of Python and PyTorch are you using?

I tried with what is recommended in the documentation and after barely managing to install the recommended versions of Python and PyTorch and MLAgents then ML Agents decided not to work with some random protocol buffers error.

What versions are you guys using?

So, after all I managed to install the environment and get it going. These are the versions of Windows, Unity and Python I have.

Win 11 Pro 10.0.22621 Build 22621
Unity 2022.2.14f1
Python 3.10.8

Cloned release_20 of ml-agents to my drive and installed it from there (the last two pip3 commands).

Here are the commands I used to setup everything, should be self-explanatory.

Before installing ml-agents did the following changes to ml-agents-envs/setup.py
Changed “numpy>=1.14.1”, to “numpy>=1.14.1,<1.24”, in line #54 and deleted line #60 “numpy==1.21.2”,

python -m venv python-envs\sample-env
.\python-envs\unityml-env\Scripts\Activate.ps1
pip install --upgrade pip
pip3 install torch==2.0.0+cu118 -f https://download.pytorch.org/whl/torch_stable.html
pip3 uninstall numpy
pip3 install numpy==1.23.5
pip uninstall protobuf
pip install protobuf==3.20.3
pip3 install onnx==1.13.1
cd <to wherever you cloned ml-agents>
pip3 install -e ./ml-agents-envs
pip3 install -e ./ml-agents```
Hope this helps someone, because I needed a day or two to figure it out.
vooood69:

So, after all I managed to install the environment and get it going. These are the versions of Windows, Unity and Python I have.
Hope this helps someone, because I needed a day or two to figure it out.

I’ve done this a handful of times in the last year, but this really help.

Thanks man for making life that little bit smoother today :smile:

vooood69:

So, after all I managed to install the environment and get it going. These are the versions of Windows, Unity and Python I have.

Win 11 Pro 10.0.22621 Build 22621
Unity 2022.2.14f1
Python 3.10.8

Cloned release_20 of ml-agents to my drive and installed it from there (the last two pip3 commands).

Here are the commands I used to setup everything, should be self-explanatory.

Before installing ml-agents did the following changes to ml-agents-envs/setup.py
Changed “numpy>=1.14.1”, to “numpy>=1.14.1,<1.24”, in line #54 and deleted line #60 “numpy==1.21.2”,

python -m venv python-envs\sample-env
.\python-envs\unityml-env\Scripts\Activate.ps1
pip install --upgrade pip
pip3 install torch==2.0.0+cu118 -f https://download.pytorch.org/whl/torch_stable.html
pip3 uninstall numpy
pip3 install numpy==1.23.5
pip uninstall protobuf
pip install protobuf==3.20.3
pip3 install onnx==1.13.1
cd <to wherever you cloned ml-agents>
pip3 install -e ./ml-agents-envs
pip3 install -e ./ml-agents```
Hope this helps someone, because I needed a day or two to figure it out.

You are an absolute bloody legend. Follow these steps to the T and it’ll work flawlessly.

This advice is fantastic. When trying to install I was having endless dependency confilcts that were seemingly impossible to reconcile. Using ubuntu 22.04 I did the following, based on the steps above:

Cloned the mlagents repo
Created completey basic anaconda environment with python 3.10.8
Installed nothing and made no changes to the environment
Navigated to ml-agents directory

pip install -e ./ml-agents

This allowed pip to resolve all the dependencies properly, and it installed eveything successfully in one step.

After cloning and running these commands:

conda create --name mlagents python==3.10.8
conda activate mlagents
cd ml-agents
pip install -e ./ml-agents

the command mlagents-learn would start the server successfully.

I made no changes to the source.

It got the right versions for everything, pytorch, protobuf, etc.

vooood69:

So, after all I managed to install the environment and get it going. These are the versions of Windows, Unity and Python I have.

Win 11 Pro 10.0.22621 Build 22621
Unity 2022.2.14f1
Python 3.10.8

Cloned release_20 of ml-agents to my drive and installed it from there (the last two pip3 commands).

Here are the commands I used to setup everything, should be self-explanatory.

Before installing ml-agents did the following changes to ml-agents-envs/setup.py
Changed “numpy>=1.14.1”, to “numpy>=1.14.1,<1.24”, in line #54 and deleted line #60 “numpy==1.21.2”,

python -m venv python-envs\sample-env
.\python-envs\unityml-env\Scripts\Activate.ps1
pip install --upgrade pip
pip3 install torch==2.0.0+cu118 -f https://download.pytorch.org/whl/torch_stable.html
pip3 uninstall numpy
pip3 install numpy==1.23.5
pip uninstall protobuf
pip install protobuf==3.20.3
pip3 install onnx==1.13.1
cd <to wherever you cloned ml-agents>
pip3 install -e ./ml-agents-envs
pip3 install -e ./ml-agents```
Hope this helps someone, because I needed a day or two to figure it out.

This works perfect ^^ thanks