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

Trouble performing imitation learning #2399

Closed rajatpaliwal closed 5 years ago

rajatpaliwal commented 5 years ago

Hi all, While trying to perform online imitation learning in my custom made environment, as I give training command (" mlagents-learn config/online_bc_config.yaml --train --slow") in the command prompt it prompts me to press the play button. Since my environment is heavy it takes some time to start after pressing the play button , in the meantime command prompt gives me the error" The Unity environment took too long to respond". Any suggestion on increasing the wait time of the training command so that I can start the training of the environment.

ervteng commented 5 years ago

The easiest way would be to navigate to the environment file (https://github.com/Unity-Technologies/ml-agents/blob/master/ml-agents-envs/mlagents/envs/environment.py) and modify the timeout_wait parameter to greater than 30 seconds.

Note that there is also a known issue with the online BC trainer that will be resolved shortly. If you're having further trouble, try checking out the hotfix-0.9.0a branch.

rajatpaliwal commented 5 years ago

Hi @ervteng , I tried modifying the timeout_wait parameter to greater than 30 seconds. I set it to 60 secs but it is still stopping at 30 secs. What else can I change to delay the timeout parameter.

rajatpaliwal commented 5 years ago

Hello, I am trying to modify the timeout_wait parameter to greater than 30 seconds. I did the necessary changes in the environment.py file and rpc_communicator.py file but still the timeout is happening at 30 seconds. Can anyone suggest any other changes in order to delay the timeout .

ervteng commented 5 years ago

Hi @rajatpaliwal, I tested changing it in rpc_communicator and it did extend the timeout. If you change the 30 in line 34 it should work.

rajatpaliwal commented 5 years ago

Hi @ervteng , I tried changing it in both rpc_communicator as well as environment.py. But the timeout was taking place at 30 seconds only. Do you suggest changing the value only in rpc_communicator file and not in environment.py file.

ervteng commented 5 years ago

Just rpc_communicator made my timeout much longer

rajatpaliwal commented 5 years ago

Somehow not working in mine even after just making changes in rpc_communicator or in both environment.py and rpc_communicator. Do you think I should delete some summaries or some log data to make this command work.

ervteng commented 5 years ago

Hi @rajatpaliwal, did you install ml-agents through pip? if you did there's a pre-compiled version of ML-Agents installed somewhere that doesn't change when you edit your files, this might explain why the behavior isn't changing.

rajatpaliwal commented 5 years ago

Hi @ervteng . Yes, I did installed ml-agents through pip. Is there a way to remove that pre-compiled version of ML-Agents. Or, I need to uninstall the ML-Agent and then re-install them through some other method?

ervteng commented 5 years ago

Yes, do pip uninstall ml-agents and pip uninstall ml-agents-envs. Then browse to your ml-agents directory, enter the ml-agents-envs sub-directory, and run pip install -e ./. Then enter the ml-agents sub-directory and do the same. That will install your source version of ml-agents into pip, so any code modifications will work

rajatpaliwal commented 5 years ago

Yes, uninstalling ml-agents-envs and ml-agents and reinstalling them with pip install -e ./ allowed code modification to work I was able to delay the timeout_wait parameter to more than 30 secs. Thanks @ervteng for your help.

ervteng commented 5 years ago

Glad it helped. Closing the issue for now - feel free to open it back up if you're still running into problems.

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.