obstacle-tower-env icon indicating copy to clipboard operation
obstacle-tower-env copied to clipboard

API number not compatible between Unity and Python. Python API : API-8, Unity API : API-6

Open panda-saroj opened this issue 6 years ago • 8 comments

Have installed Unity 2018.3.13f1 on Linux Ubuntu 16.04 Based on the requirements of obstacle-tower-env, have installed mlagents 0.6.2 and mlagents-envs 0.6.2

When I try to train the obstacle-tower using mlagents-learn, I get the error API number not compatible between Unity and Python. Python API : API-8, Unity API : API-6

How do I downgrade Python API to API-8?

panda-saroj avatar Apr 22 '19 04:04 panda-saroj

Hello @saroj-uta

It seems that you likely have another installation of mlagents with a greater version number than 0.6.2.

awjuliani avatar Apr 22 '19 17:04 awjuliani

I did pip3 install mlagents==0.6

That solved my problem. But, I am wondering, why installing from source did’t work. I had specified mlagents version as 0.6 in the setup.py and had installed it using

Pip3 install -e . Pip3 list | grep mlagents also showed version as 0.6 when I had installed from source.

Best Regard, Saroj

From: Arthur Juliani [email protected] Sent: Monday, April 22, 2019 12:29 PM To: Unity-Technologies/obstacle-tower-env [email protected] Cc: Panda, Saroj K [email protected]; Mention [email protected] Subject: Re: [Unity-Technologies/obstacle-tower-env] API number not compatible between Unity and Python. Python API : API-8, Unity API : API-6 (#86)

Hello @saroj-utahttps://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsaroj-uta&data=02%7C01%7Csaroj.panda%40mavs.uta.edu%7Cfa48581425c34f75311808d6c747fa5a%7C5cdc5b43d7be4caa8173729e3b0a62d9%7C0%7C0%7C636915509288379108&sdata=tCm7%2FrYOkSzMzvWrdB3zO%2BcvdR4NwFbWBKA%2Bsmgprko%3D&reserved=0

It seems that you likely have another installation of mlagents with a greater version number than 0.6.2.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FUnity-Technologies%2Fobstacle-tower-env%2Fissues%2F86%23issuecomment-485485281&data=02%7C01%7Csaroj.panda%40mavs.uta.edu%7Cfa48581425c34f75311808d6c747fa5a%7C5cdc5b43d7be4caa8173729e3b0a62d9%7C0%7C0%7C636915509288389117&sdata=HmGDkhLfie139LCyC442uAn5HPtktpk8wOZlWqnqfO8%3D&reserved=0, or mute the threadhttps://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAECM24H2ERSGBWYVKGECUJDPRXYU5ANCNFSM4HHNLN4Q&data=02%7C01%7Csaroj.panda%40mavs.uta.edu%7Cfa48581425c34f75311808d6c747fa5a%7C5cdc5b43d7be4caa8173729e3b0a62d9%7C0%7C0%7C636915509288389117&sdata=WtR5TFYDdompBu3DmGnyfCcKVJkWVrTNcnwuYjuMWyY%3D&reserved=0.

panda-saroj avatar Apr 22 '19 19:04 panda-saroj

In the AI Crowd forum it was said that v2.0 would include the new ml-agents version. Right now it looks like it still requires ml-agents<0.7, will there be another update?

vkakerbeck avatar May 16 '19 10:05 vkakerbeck

Hi @vkakerbeck

Our team had an internal discussion concerning this, and we decided to keep the requirements as-is for Round 2. The reasoning was that participants who have made it to Round 2 are already using the 0.6 release, and therefore would not benefit from the upgrade, whereas it may introduce other incompatibilities. For the open source release in a couple months we plan to upgrade to the current version of ml-agents package at that point. Apologies for the inconvenience this may cause.

awjuliani avatar May 16 '19 15:05 awjuliani

Hi @awjuliani, thank you for your fast reply! Is there some workaround how I could use the num-envs parameter introduced here https://blogs.unity3d.com/2019/04/15/unity-ml-agents-toolkit-v0-8-faster-training-on-real-games/ in order to speed up the training? It would be extremely useful to be able to use this.

vkakerbeck avatar May 16 '19 15:05 vkakerbeck

Hi @vkakerbeck

In the near-term I would recommend using OpenAI baselines to train with multiple concurrent instances of the environment. You can find instructions here: https://github.com/Unity-Technologies/ml-agents/tree/master/gym-unity

awjuliani avatar May 19 '19 18:05 awjuliani

I have most updated ml-agents 1.7.2 and am now getting same issue.:

Version information: ml-agents: 0.22.0, ml-agents-envs: 0.22.0, Communicator API: 1.2.0, PyTorch: 1.7.0+cu110 2021-02-04 15:44:20 INFO [learn.py:275] run_seed set to 7748 2021-02-04 15:44:22 INFO [environment.py:205] Listening on port 5004. Start training by pressing the Play button in the Unity Editor. 2021-02-04 15:44:31 WARNING [environment.py:104] WARNING: The communication API versions between Unity and python differ at the minor version level. Python API: 1.2.0, Unity API: 1.3. This means that some features may not work unless you upgrade the package with the lower version.Please find the versions that work best together from our release page. https://github.com/Unity-Technologies/ml-agents/releases 2021-02-04 15:45:31 INFO [subprocess_env_manager.py:184] UnityEnvironment worker 0: environment stopping. 2021-02-04 15:45:31 INFO [trainer_controller.py:85] Saved Model Traceback (most recent call last): File "C:\Program Files\Python36\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\Program Files\Python36\lib\runpy.py", line 85, in run_code exec(code, run_globals) File "C:\Users\jon.f.hauris\python-envs\focus\Scripts\mlagents-learn.exe_main.py", line 7, in File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents\trainers\learn.py", line 280, in main run_cli(parse_command_line()) File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents\trainers\learn.py", line 276, in run_cli run_training(run_seed, options) File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents\trainers\learn.py", line 153, in run_training tc.start_learning(env_manager) File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents_envs\timers.py", line 305, in wrapped return func(*args, **kwargs) File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents\trainers\trainer_controller.py", line 174, in start_learning self._reset_env(env_manager) File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents_envs\timers.py", line 305, in wrapped return func(*args, **kwargs) File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents\trainers\trainer_controller.py", line 109, in _reset_env env_manager.reset(config=new_config) File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents\trainers\env_manager.py", line 66, in reset self.first_step_infos = self._reset_env(config) File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents\trainers\subprocess_env_manager.py", line 290, in _reset_env ew.previous_step = EnvironmentStep(ew.recv().payload, ew.worker_id, {}, {}) File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents\trainers\subprocess_env_manager.py", line 91, in recv raise env_exception mlagents_envs.exception.UnityTimeOutException: The Unity environment took too long to respond. Make sure that : The environment does not need user interaction to launch The Agents' Behavior Parameters > Behavior Type is set to "Default" The environment and the Python interface have compatible versions.

jfhauris avatar Feb 04 '21 20:02 jfhauris

Hi @jfhauris

I would recommend using the latest supported version of ML-Agents with Obstacle Tower, which is 1.1.

awjuliani avatar Feb 05 '21 18:02 awjuliani