Unity-Technologies / ml-agents

The Unity Machine Learning Agents Toolkit (ML-Agents) is an open-source project that enables games and simulations to serve as environments for training intelligent agents using deep reinforcement learning and imitation learning.
https://unity.com/products/machine-learning-agents
Other
17.19k stars 4.16k forks source link

EC2 instance ami-016ff5559334f8619 incompatible with current version? #2022

Closed increpare closed 5 years ago

increpare commented 5 years ago

following the instructions here, starting with a headless instance in python:

>>> from mlagents.envs import UnityEnvironment
>>> env = UnityEnvironment("walker")
Found path: /home/ubuntu/walker/walker.x86_64
Mono path[0] = '/home/ubuntu/walker/walker_Data/Managed'
Mono config path = '/home/ubuntu/walker/walker_Data/MonoBleedingEdge/etc'
Preloaded 'libgrpc_csharp_ext.x64.so'
Initialize engine version: 2019.1.1f1 (fef62e97e63b)
Forcing GfxDevice: Null
GfxDevice: creating device client; threaded=0
NullGfxDevice:
    Version:  NULL 1.0 [1.0]
    Renderer: Null Device
    Vendor:   Unity Technologies
Begin MonoManager ReloadAssembly
- Completed reload, in  0.086 seconds
UnloadTime: 0.894129 ms
initializing

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 48)

Fallback handler could not load library /home/ubuntu/walker/walker_Data/Mono/libcoreclr.so
Fallback handler could not load library /home/ubuntu/walker/walker_Data/Mono/libcoreclr.so
Fallback handler could not load library /home/ubuntu/walker/walker_Data/Mono/libcoreclr.so
Fallback handler could not load library /home/ubuntu/walker/walker_Data/Mono/libSystem.dylib
Fallback handler could not load library /home/ubuntu/walker/walker_Data/Mono/libSystem.dylib.so
Fallback handler could not load library /home/ubuntu/walker/walker_Data/Mono/libSystem.dylib
Fallback handler could not load library /home/ubuntu/walker/walker_Data/Mono/libcoreclr.so
Fallback handler could not load library /home/ubuntu/walker/walker_Data/Mono/libcoreclr.so
Fallback handler could not load library /home/ubuntu/walker/walker_Data/Mono/libcoreclr.so
Fallback handler could not load library /home/ubuntu/walker/walker_Data/Mono/libSystem.dylib
Fallback handler could not load library /home/ubuntu/walker/walker_Data/Mono/libSystem.dylib.so
Fallback handler could not load library /home/ubuntu/walker/walker_Data/Mono/libSystem.dylib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/ml-agents/ml-agents/mlagents/envs/environment.py", line 73, in __init__
    "of ML-Agents.".format(self._version_, self._unity_version))
mlagents.envs.exception.UnityEnvironmentException: The API number is not compatible between Unity and python. Python API : API-5, Unity API : API-8.
Please go to https://github.com/Unity-Technologies/ml-agents to download the latest version of ML-Agents.

using the version of ml-agents current as of today (can't find any version number) and the recommended ami ami-016ff5559334f8619

trying to remove + rebuild ml-agents results in an error because pip is python3.5 on the image, but this requires 3.6


Cloning into 'ml-agents'...

remote: Enumerating objects: 38, done.
remote: Counting objects: 100% (38/38), done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 16494 (delta 13), reused 30 (delta 12), pack-reused 16456
Receiving objects: 100% (16494/16494), 247.95 MiB | 57.21 MiB/s, done.
Resolving deltas: 100% (10870/10870), done.

Checking connectivity... done.
ubuntu@ip-172-31-88-213:~$ cd ml-agents/ml-agents/
ubuntu@ip-172-31-88-213:~/ml-agents/ml-agents$ pip3 install -e .
Obtaining file:///home/ubuntu/ml-agents/ml-agents
mlagents requires Python '>=3.6,<3.7' but the running Python is 3.5.2
You are using pip version 10.0.1, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.```
increpare commented 5 years ago

I also tried with "Deep Learning AMI (Ubuntu) Version 22.0 (ami-060865e8b5914b4c4)" as recommended in the "install yourself" route, and got the same problems

Cloning into 'ml-agents'...
remote: Enumerating objects: 38, done.
remote: Counting objects: 100% (38/38), done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 16494 (delta 13), reused 30 (delta 12), pack-reused 16456
Receiving objects: 100% (16494/16494), 247.95 MiB | 53.41 MiB/s, done.
Resolving deltas: 100% (10870/10870), done.
Checking connectivity... done.
(python3) ubuntu@ip-172-31-36-212:~$ cd ml-agents/ml-agents/
(python3) ubuntu@ip-172-31-36-212:~/ml-agents/ml-agents$ pip3 install -e .
Obtaining file:///home/ubuntu/ml-agents/ml-agents
mlagents requires Python '>=3.6,<3.7' but the running Python is 3.5.2
You are using pip version 19.0.3, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
ervteng commented 5 years ago

As the error suggests, it's because the VM is using python 3.5.2 and not 3.6. @xiaomaogy, do you know if it's always been like that, or if it's a recent change to the VM? AFAIK we've not supported Python 3.5.2 for a while.

@increpare, if you want to live a bit on the dangerous side, you can modify the setup.py in ml-agents and remove this line python_requires=">=3.6,<3.7". It should install and run, though no guarantees that everything works.

increpare commented 5 years ago

(FWIW I 'solved' my problem eventually in a screen session by copypaste-ing a jumble of random upgrade/environment commands from online to get everything to 3.6 - nothing I can easily reconstruct to post here though)

Am Fr., 10. Mai 2019 um 19:41 Uhr schrieb Ervin T. <notifications@github.com

:

As the error suggests, it's because the VM is using python 3.5.2 and not 3.6. @xiaomaogy https://github.com/xiaomaogy, do you know if it's always been like that, or if it's a recent change to the VM? AFAIK we've not supported Python 3.5.2 for a while.

@increpare https://github.com/increpare, if you want to live a bit on the dangerous side, you can modify the setup.py in ml-agents and remove this line python_requires=">=3.6,<3.7". It should install and run, though no guarantees that everything works.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Unity-Technologies/ml-agents/issues/2022#issuecomment-491372161, or mute the thread https://github.com/notifications/unsubscribe-auth/AADRVYFF4IBZSQ4QENGGHVTPUWXTZANCNFSM4HL3CRYQ .

xiaomaogy commented 5 years ago

@ervteng I remember on the instance there is a list of python environment you could pick from, and it is very easy to choose python 3.6 without a jumble of random upgrade commands. However I haven't used the ami for a while, so not sure what happens to it now.

harperj commented 5 years ago

Thanks for reaching out to us. Hopefully you were able to resolve your issue. We are closing this due to inactivity, but if you need additional assistance, feel free to reopen the issue.

github-actions[bot] commented 3 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.