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.14k forks source link

Offline Behavioral Cloning: The provided demonstration is not compatible with the brain being used for performance evaluation. #2434

Closed tillmusshoff closed 5 years ago

tillmusshoff commented 5 years ago

Hi! I am trying to get my environment running with BC. I did everything like the Imitation Learning Guide suggested. I recorded a .demo file while playing with the PlayerBrain. Then I changed to the learning brain, checked "Control" and inserted the path to the demo file into the offline_bc_config.yaml. However, when I start the training in the editor or as a built I get this error: "The provided demonstration is not compatible with the brain being used for performance evaluation." See the full error message in the screenshot below.

b1f7f51475e8798472acabd037e2a8a0

Unity also gives me this error: NullReferenceException: Object reference not set to an instance of an object MLAgents.Batcher.SendAcademyParameters (MLAgents.CommunicatorObjects.UnityRLInitializationOutput academyParameters) (at Assets/ML-Agents/Scripts/Batcher.cs:96) MLAgents.Academy.InitializeEnvironment () (at Assets/ML-Agents/Scripts/Academy.cs:345) MLAgents.Academy.Awake () (at Assets/ML-Agents/Scripts/Academy.cs:250)

The environment was previously used with PPO without a problem. Do I need to discard any types of rewards or observations or anything else?

This is the Academy/Agent Setup:

2cf5a2e17b9f2f18acb644d5a37aaa83

772f8d212ae105851f4f02cddcf9ed8d

eaa86c893fac3162b65792ca31d2a822

Thanks in advance!

vincentpierre commented 5 years ago

Hi, The error The provided demonstration is not compatible with the brain being used for performance evaluation arrises when the parameters of the brain used to record the demonstrations are not strictly identical to the parameters of the learning brain. These parameters are :

Please make sure that all of these were identical to the learning brain when recording demonstrations.

tillmusshoff commented 5 years ago

Thanks for helping out. There was a typo in the vector_action_description. Never thought that this causes the issue. Thanks again!

ghost commented 5 years ago

@tillmusshoff I have just started working with the Unity ML-Toolkit. I see there are plenty of examples in the ML agents for most of the algorithms, however, none for the behavioral cloning.

I am trying to use offline behavioral cloning method to train a NPC in a FPS game. I don't know how to go around the Academy and Agent Scripts for this and have found neither proper documentation nor remotely close example to be able to understand and reciprocate something similar.

Any help would be appreciated.

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.