-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Hi,
I got a error when I run the command:
mlagents-learn trainer_config.yaml --run-id=test_run --train --slow
The error is :
File "/home/bohan/Downloads/ml-agents/ml-agents/mlagents/trainers/models.py", line 595, in create_dc_actor_critic
output = tf.concat([output_pre,is_collect],1)
UnboundLocalError: local variable 'is_collect' referenced before assignment
I checked the python file and found:
output_pre = output[:,0:2]
if self.with_heuristics:
is_collect = self.is_collect_tf(self.fused_visual_in)
output = tf.concat([output_pre,is_collect],1)
self.output = tf.identity(output, name="action")
In this training command, the parameter heuristics is false so the value of is_collect wont be given, which leads to the error. I dont know what is_collect should be if heuristics is false. Could you please help me ?
By the way, after I load the project in unity, there are no any compile errors but once I run the training command, there are two errors:
- Instance of CoreBrainInternal couldn't be created. The the script class needs to derive from ScriptableObject.
UnityEngine.ScriptableObject:CreateInstance (string)
MLAgents.Brain:UpdateCoreBrains () (at Assets/ML-Agents/Scripts/Brain.cs:144)
MLAgents.Brain:InitializeBrain (MLAgents.Academy,MLAgents.Batcher) (at Assets/ML-Agents/Scripts/Brain.cs:206)
MLAgents.Academy:InitializeEnvironment () (at Assets/ML-Agents/Scripts/Academy.cs:288)
MLAgents.Academy:Awake () (at Assets/ML-Agents/Scripts/Academy.cs:227)
2.UnityAgentsException: The Communicator was unable to connect. Please make sure the External process is ready to accept communication with Unity.
MLAgents.Batcher.SendAcademyParameters (MLAgents.CommunicatorObjects.UnityRLInitializationOutput academyParameters) (at Assets/ML-Agents/Scripts/Batcher.cs:83)
MLAgents.Academy.InitializeEnvironment () (at Assets/ML-Agents/Scripts/Academy.cs:320)
MLAgents.Academy.Awake () (at Assets/ML-Agents/Scripts/Academy.cs:227)
So far, I just tried the training part 1 and didn't put the pre-trained model into unity. Are these two errors only related to inference part?
Unity Version: 2020.3.6f1
Unity machine OS + version: Ubuntu 20.04
Thanks!
Albert