{"record":{"id":"c1a9fc21d7c240d2","repo":"Unity-Technologies/ml-agents","slug":"unknown-tensorproxy-expected-as-input-tensor-na","errorCode":null,"errorMessage":"Unknown tensorProxy expected as input : {tensor.name}","messagePattern":"Unknown tensorProxy expected as input : (.+?)","errorType":"exception","errorClass":"UnityAgentsException","httpStatus":null,"severity":"error","filePath":"com.unity.ml-agents/Runtime/Inference/TensorGenerator.cs","lineNumber":172,"sourceCode":"        /// Populates the data of the tensor inputs given the data contained in the current batch\n        /// of agents.\n        /// </summary>\n        /// <param name=\"tensors\"> Enumerable of tensors that will be modified.</param>\n        /// <param name=\"currentBatchSize\"> The number of agents present in the current batch\n        /// </param>\n        /// <param name=\"infos\"> List of AgentsInfos and Sensors that contains the\n        /// data that will be used to modify the tensors</param>\n        /// <exception cref=\"UnityAgentsException\"> One of the tensor does not have an\n        /// associated generator.</exception>\n        public void GenerateTensors(\n            IReadOnlyList<TensorProxy> tensors, int currentBatchSize, IList<AgentInfoSensorsPair> infos)\n        {\n            for (var tensorIndex = 0; tensorIndex < tensors.Count; tensorIndex++)\n            {\n                var tensor = tensors[tensorIndex];\n                if (!m_Dict.ContainsKey(tensor.name))\n                {\n                    throw new UnityAgentsException(\n                        $\"Unknown tensorProxy expected as input : {tensor.name}\");\n                }\n                m_Dict[tensor.name].Generate(tensor, currentBatchSize, infos);\n            }\n        }\n    }\n}\n","sourceCodeStart":154,"sourceCodeEnd":180,"githubUrl":"https://github.com/Unity-Technologies/ml-agents/blob/3ecb446f75d1e7400eb404c562dc005d3164cffc/com.unity.ml-agents/Runtime/Inference/TensorGenerator.cs#L154-L180","documentation":"TensorGenerator.GenerateTensors iterates the tensors the model expects as inputs and looks each up by name among the registered input generators. An input tensor name with no registered generator cannot be filled, so it throws. This is the input-side counterpart of the TensorApplier unknown-output error.","triggerScenarios":"Running inference with a model that requires an input tensor (e.g. recurrent memory, mask, or observation tensor) whose name wasn't registered during initialization — typically a naming mismatch between the model and the plugin's TensorNames conventions.","commonSituations":"Model exported by a different ml-agents version with renamed inputs; custom ONNX graphs with extra inputs; memory/mask tensors present in the model while the agent wasn't configured with recurrence (or vice versa).","solutions":["Re-export the model with the matching ml-agents trainer version so input names follow TensorNames conventions","Align Agent Behavior Parameters with the model (e.g. enable memory if the model has recurrent inputs)","Match com.unity.ml-agents and Python ml-agents package versions"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"foreach (var inputName in modelInputTensorNames)\n    if (!TensorUtils.TensorNamesIncludesExpected(inputName))\n        throw new InvalidOperationException($\"Model requires unregistered input: {inputName}\");","typeGuard":null,"tryCatchPattern":"try { tensorGenerator.GenerateTensors(tensors, batchSize, infos); }\ncatch (UnityAgentsException e) when (e.Message.Contains(\"Unknown tensorProxy expected as input\"))\n{ Debug.LogError(\"Model input names/names mismatch — re-export the model with the matching trainer version.\"); }","preventionTips":["Match trainer and Unity plugin versions","Enable Agent memory only when the model has recurrent inputs (and vice versa)","Inspect the exported model's input names against ML-Agents TensorNames conventions"],"tags":["unity","ml-agents","inference","tensor","naming-mismatch"],"backgroundTag":"model-tensor-shape-mismatch","analyzedSha":"3ecb446f75d1e7400eb404c562dc005d3164cffc","analyzedAt":"2026-09-02T16:33:12.832Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}