Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Resolved Can't load generated .onnx file into Behavior Parameters with 3DBall example

Discussion in 'ML-Agents' started by bobchalmers, May 8, 2021.

  1. bobchalmers

    bobchalmers

    Joined:
    Jun 2, 2013
    Posts:
    6
    training with the 3DBall example - training runs seemingly fine, generates 3DBall.onnx

    Can't drag this file into BehaviorParameters Model field in inspector (prefab or instantiated agent).

    Error in Barracuda code line 152
    var isContinuousInt = (int)model.GetTensorByName(TensorNames.IsContinuousControl)[0];
    appears as below:

    Unity 2020.3.1f1

    NullReferenceException: Object reference not set to an instance of an object
    Unity.MLAgents.Inference.BarracudaModelParamLoader.CheckModel (Unity.Barracuda.Model model, Unity.MLAgents.Policies.BrainParameters brainParameters, Unity.MLAgents.Sensors.SensorComponent[] sensorComponents, Unity.MLAgents.Policies.BehaviorType behaviorType) (at Library/PackageCache/com.unity.ml-agents@1.0.7/Runtime/Inference/BarracudaModelParamLoader.cs:152)
    Unity.MLAgents.Editor.BehaviorParametersEditor.DisplayFailedModelChecks () (at Library/PackageCache/com.unity.ml-agents@1.0.7/Editor/BehaviorParametersEditor.cs:108)
    Unity.MLAgents.Editor.BehaviorParametersEditor.OnInspectorGUI () (at Library/PackageCache/com.unity.ml-agents@1.0.7/Editor/BehaviorParametersEditor.cs:68)
    UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <0fdaf67e8e744beea25e77915c19f81b>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)
     
  2. bobchalmers

    bobchalmers

    Joined:
    Jun 2, 2013
    Posts:
    6
    SOLVED - I was using Python release 26 with ml-agents Unity v1.07 and missed the warnings
     
    christophergoy likes this.