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
16.93k stars 4.13k forks source link

The agent does not move and just stands still. #3000

Closed SERGZV closed 4 years ago

SERGZV commented 4 years ago

Hello, I have the same problem as this guy. https://github.com/Unity-Technologies/ml-agents/issues/2981

I am learning this lesson. https://www.youtube.com/watch?v=axF_nHHchFQ

However, that lesson is for version 0.8 and I have version 0.11 And since these versions have significant differences, namely, they removed the brain and replaced it with the BehaviourParametrs script. I most likely did something wrong.

When I launch nn through the console, the startup goes fine (I suppose) Unity launch

Then I press the start button and the agent (penguin) does not move without giving any errors. Further in the console I get an error. UnityEnviroment worker: recv failed Unity errors

Here are the project screenshots>

Inspector & Hierarhy Inspector   Hierarhy

PenguinAcademy PenguinAcademy

PenguinArea PenguinArea_1 PenguinArea_2

PenguinAgent PenguinAgent_1 PenguinAgent_2 PenguinAgent_3

TrainerConfig.yaml TrainerConfig yaml

PenguinLearning.json PenguinLearning(json)

Here https://github.com/Unity-Technologies/ml-agents/issues/2981 they said that there is not enough data, but I honestly did not understand the screenshot of what else that guy should have done. If you need any more data, tell me.

Please help.

shihzy commented 4 years ago

hi @SERGZV - taking a look.

SERGZV commented 4 years ago

@unityjeffrey - Hello, look at what?

shihzy commented 4 years ago

hi - we think the problem is that we switched the port for training in 0.11. And if you had a version mismatch between the C# SDK and Python, it would never hit the error because of the port change.

Can you make sure both the C# code and Python code is updated using the same version and see if that fixes your issue?

SERGZV commented 4 years ago

So. For training "ML-Agents" I use unity version 2019.2.12f1 In Project settings> Player: I changed "NET 2.x" to "NET 4.x" Using the "unity hub" downloaded and installed a new version of unity jdk sdk and ndk (cool done now no need to go and download from external pages, if only ML-Agents and the right version of Python could also be installed) The python version was installed 3.6.6 since everywhere where I didn’t read it was advised to install this particular 3.6.x. However, since you said python, you also need to update I uninstalled the old python version and installed the python version 3.8.0. And launched the console again. Now in the console when entering commands: <<mlagents-learn config/trainer_config.yaml --curriculum=config/curricula/Penguin --run-id=Project_0 --train>> & <> I get an error: Is not an internal or external command, executable program or batch file. Now no matter what version of python I install, I get the same error in the console :-( The point cannot be in the wrong path or command, because the path and command were saved in my notebook and all the time I just copied them to the console like this time. This problem appeared just after reinstalling python

shihzy commented 4 years ago

hi @SERGZV - which version of the C# code from ML-Agents are you using (i.e. 0.8, 0.9, etc..)? When you upgrade to 0.11, you will need to upgrade both the C# scripts and Python.

SERGZV commented 4 years ago

I wrote the code for the lesson version 0.8. However, I originally used version 0.11 since there is no video tutorial for version 0.11. The comments in the video tutorial indicated what changes need to be made to work in version 0.11. Namely, the override virtual method "Heuristic" in the agent class, which inherits from the agent class. What changes I need to make to the code to work in version 0.11 I honestly don’t know.

shihzy commented 4 years ago

hi @SERGZV - if you are upgrading to 0.11, make sure to copy the files from /ml-agents/UnitySDK/Assets/ML-Agents/Scripts/ from the 0.11 release to your project as well.

SERGZV commented 4 years ago

I did not upgrade to version 0.11. I immediately started working in it.

SERGZV commented 4 years ago

And right at the beginning I copied the ML-agents folder in unity assets which contained scripts as well as training examples that worked, except for those that required the "Heuristic" method

What version of python should be installed for version 0.11 of ml agents?

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.