Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
panda-saroj opened this issue Apr 22, 2019 · 8 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@panda-saroj
Copy link

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?

@awjuliani
Copy link
Contributor

Hello @saroj-uta

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

@awjuliani awjuliani self-assigned this Apr 22, 2019
@awjuliani awjuliani added the help wanted Extra attention is needed label Apr 22, 2019
@panda-saroj
Copy link
Author

panda-saroj commented Apr 22, 2019 via email

@vkakerbeck
Copy link

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?

@awjuliani
Copy link
Contributor

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.

@vkakerbeck
Copy link

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.

@awjuliani
Copy link
Contributor

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

@jfhauris
Copy link

jfhauris commented Feb 4, 2021

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.

@awjuliani
Copy link
Contributor

Hi @jfhauris

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants