Heuristic vs External - ArgumentNullException: Value cannot be null.
Hey everybody,
we tried to let our rl agent learn vs our heuristic agent, but we get an error, when we start the game. Every other combination of agents works fine: Player vs. heuristic, Player vs. Player, Extern vs. Extern, Extern vs. Intern, Player vs Intern.
System: Unity2018.2.0f2 Requirements like in requirements.txt Except using tensirflow-gpu 1.8.0
StackTrace:
ArgumentNullException: Value cannot be null.
Parameter name: values
Google.Protobuf.ProtoPreconditions.CheckNotNull[T] (T value, System.String name) (at <53efaed03be741309d533ea799514544>:0)
Google.Protobuf.Collections.RepeatedField1[T].AddRange (System.Collections.Generic.IEnumerable1[T] values) (at <53efaed03be741309d533ea799514544>:0)
Google.Protobuf.Collections.RepeatedField1[T].Add (System.Collections.Generic.IEnumerable1[T] values) (at <53efaed03be741309d533ea799514544>:0)
MLAgents.Batcher.AgentInfoConvertor (MLAgents.AgentInfo info) (at Assets/ML-Agents/Scripts/Batcher.cs:170)
MLAgents.Batcher.SendBrainInfo (System.String brainKey, System.Collections.Generic.Dictionary2[TKey,TValue] agentInfo) (at Assets/ML-Agents/Scripts/Batcher.cs:259)
MLAgents.CoreBrainHeuristic.DecideAction (System.Collections.Generic.Dictionary2[TKey,TValue] agentInfo) (at Assets/ML-Agents/Scripts/CoreBrainHeuristic.cs:53)
MLAgents.Brain.DecideAction () (at Assets/ML-Agents/Scripts/Brain.cs:243)
MLAgents.Academy.EnvironmentStep () (at Assets/ML-Agents/Scripts/Academy.cs:578)
MLAgents.Academy.FixedUpdate () (at Assets/ML-Agents/Scripts/Academy.cs:604)
Google.Protobuf.Collections.RepeatedField1[T].Add (System.Collections.Generic.IEnumerable1[T] values) (at <53efaed03be741309d533ea799514544>:0)
MLAgents.Batcher.AgentInfoConvertor (MLAgents.AgentInfo info) (at Assets/ML-Agents/Scripts/Batcher.cs:170)
MLAgents.Batcher.SendBrainInfo (System.String brainKey, System.Collections.Generic.Dictionary2[TKey,TValue] agentInfo) (at Assets/ML-Agents/Scripts/Batcher.cs:259)
MLAgents.CoreBrainHeuristic.DecideAction (System.Collections.Generic.Dictionary2[TKey,TValue] agentInfo) (at Assets/ML-Agents/Scripts/CoreBrainHeuristic.cs:53)
MLAgents.Brain.DecideAction () (at Assets/ML-Agents/Scripts/Brain.cs:243)
MLAgents.Academy.EnvironmentStep () (at Assets/ML-Agents/Scripts/Academy.cs:578)
MLAgents.Academy.FixedUpdate () (at Assets/ML-Agents/Scripts/Academy.cs:604)
Google.Protobuf.Collections.RepeatedField1[T].Add (System.Collections.Generic.IEnumerable1[T] values) (at <53efaed03be741309d533ea799514544>:0)
MLAgents.Batcher.AgentInfoConvertor (MLAgents.AgentInfo info) (at Assets/ML-Agents/Scripts/Batcher.cs:170)
MLAgents.Batcher.SendBrainInfo (System.String brainKey, System.Collections.Generic.Dictionary2[TKey,TValue] agentInfo) (at Assets/ML-Agents/Scripts/Batcher.cs:259)
MLAgents.CoreBrainHeuristic.DecideAction (System.Collections.Generic.Dictionary2[TKey,TValue] agentInfo) (at Assets/ML-Agents/Scripts/CoreBrainHeuristic.cs:53)
MLAgents.Brain.DecideAction () (at Assets/ML-Agents/Scripts/Brain.cs:243)
MLAgents.Academy.EnvironmentStep () (at Assets/ML-Agents/Scripts/Academy.cs:578)
MLAgents.Academy.FixedUpdate () (at Assets/ML-Agents/Scripts/Academy.cs:604)
Thanks for your help, let me know if you need any further information or if this has happened to anyone else. 😸
Cheers, Khaled and Chris. 🚀 🤖
Hi @KReguieg - just to clarify, are these two agents in the same scene where one is being trained and another has a Heuristic brain or are you referring to an imitation learning set-up where the teacher brain is heuristic?
Hi @mmattar - they are in the same scene, we wanted to see what happens, if we train an agent with an heuristic one. :)
Additional information:
We tried tensorflow-gpu==1.7.0 and it failed. Additionally we tried heuristic as teacher with imitation learning set-up, which failed as well. Both with the same 'Value cannot be null'-error.
Thanks @KReguieg - @vincentpierre and I will look into this.
I have a guess that something in the information the agent sends to the brain is a null value when using the Heuristic Brain. I was able to train the balance ball with a Heuristic and Imitation learning with v0.4.
Could you try to replace your decision script with the RandomDecision script in the SharedAssets folder ? If this does not work, could you insert some code into the Batcher.cs script (around line 170) and look for null values into the fields of info.
I was able to reproduce your bug by doing SetTextObs(null) into the agent code, maybe the two are related ?
I hope this helps.
Thanks for reaching out to us. Hopefully you were able to resolve your issue. We are closing this due to inactivity, but if you need additional assistance, feel free to reopen the issue.
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.