ml-agents icon indicating copy to clipboard operation
ml-agents copied to clipboard

Curriculum Learning : "The given Key was not present in the dictionary"

Open traveltrousers opened this issue 8 years ago • 5 comments

Has anyone had the examples working from ML 0.3? To my eyes the push block and wall jump has different variables than are supplied in the json file.

I've altered the 3DBall example to translate a platform beneath a randomly moving ball instead of rotating it and would like to get it working better.

I'm assuming the Curriculum lesson is reset by the academy reset - so I have :

public override void AcademyReset()
{

	TrackingEdge = (float)resetParameters["Tracking_Edge"];
}

and in the agent reset....

public override void AgentReset()
{
	float TrackingEdge = academy.GetComponent<MyBallAcademy>().TrackingEdge;

    	edge = TrackingEdge;
    }

but it throws : "The given Key was not present in the dictionary" in the console.

My NN does what I want it to do at a basic level, but I want to improve it by making it more responsive, so by moving the edge of my tracked area to make it smaller each lesson I'm hoping it will improve.

I would also like to reward the platform for not moving when the ball is close to the center... I would like : no movement at the center, a little movement outside, and a faster response when it's by the edge....

Any suggestions?

traveltrousers avatar Apr 13 '18 16:04 traveltrousers

Did you set the reset parameter into the academy inspector ? You should have a Add New reset parameters button. You could have misspell it, if the error is that the key is not present in the dictionary, try to Debug.Log all the keys in the dictionary with a for loop, this should help you debug. This is not a problem with python because python only updates the reset parameters, if it is not here in the first place, the problem should be on C#.

vincentpierre avatar Apr 13 '18 23:04 vincentpierre

I think I see the issue now... I only define the reset parameter in the academy script but you assign a value in the inspector?

traveltrousers avatar Apr 16 '18 14:04 traveltrousers

Via, script, the reset parameters should be read only. When you want to add a new reset parameters, click on the academy GameObject in the scene, at the bottom of the academy component's inspector, you will see a Reset Parameters field. image Use Add New to create a new one with appropriate value. This value can be changed during training.

vincentpierre avatar Apr 16 '18 16:04 vincentpierre

Hi @traveltrousers , we are closing this issue due to inactivity, feel free to open it if you need more help on this.

xiaomaogy avatar May 17 '18 21:05 xiaomaogy

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.

lock[bot] avatar Jan 03 '20 10:01 lock[bot]