{"record":{"id":"006ece19ce538c32","repo":"lutzroeder/netron","slug":"unknown-field-tag-this-location","errorCode":null,"errorMessage":"Unknown field '${tag}' ${this.location()}","messagePattern":"Unknown field '(.+?)' (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"source/caffe.js","lineNumber":53,"sourceCode":"            try {\n                const reader = await content.read('protobuf.text');\n                reader.field = function(tag, message) {\n                    const type = message.constructor.name;\n                    if (tag.endsWith('_param') && (type === 'LayerParameter' || type === 'V1LayerParameter' || type === 'V0LayerParameter')) {\n                        message[tag] = caffe.ModelFactory._decodeText(reader);\n                        return;\n                    } else if (message.constructor.name.endsWith('Parameter') || message.constructor.name === 'ParamSpec') {\n                        if (message[tag]) {\n                            if (!Array.isArray(message[tag])) {\n                                message[tag] = [message[tag]];\n                            }\n                            message[tag].push(this.read());\n                        } else {\n                            message[tag] = this.read();\n                        }\n                        return;\n                    }\n                    throw new Error(`Unknown field '${tag}' ${this.location()}`);\n                };\n                reader.enum = function(type) {\n                    const token = this.token();\n                    this.next();\n                    this.semicolon();\n                    if (!Object.prototype.hasOwnProperty.call(type, token)) {\n                        const value = Number.parseInt(token, 10);\n                        if (!Number.isNaN(token - value)) {\n                            return value;\n                        }\n                        return token;\n                    }\n                    return type[token];\n                };\n                if (/MobileNetSSD_train_template.prototxt/.exec(identifier)) {\n                    reader.integer = function() {\n                        const token = this.token();\n                        const value = Number.parseInt(token, 10);","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/lutzroeder/netron/blob/d8a543f5f847ef596aa58858d6adcf5d75545f7f/source/caffe.js#L35-L71","documentation":"Thrown while parsing a Caffe prototxt (NetParameter text protobuf) when a token key in the text does not correspond to any known field of the message being decoded. The custom reader.field handler only assigns recognized fields and falls through to this error for anything else, annotating it with the current parser location (line).","triggerScenarios":"Calling the Caffe open()/openNetParameterText() flow on a .prototxt that contains a field name unknown to the bundled caffe.proto schema — e.g. newer Caffe/Jolicloud additions like input_shape used in an unsupported position, typos, or non-Caffe syntax.","commonSituations":"Prototxt files from newer/patched Caffe forks (fields the bundled schema predates); hand-edited prototxt with typos; SSID/NNU or PyCaffe-exported files with dialect differences; passing a Torch/ONNX text file to the Caffe loader.","solutions":["Open the prototxt at the reported location() line and check the field name for typos or dialect-specific syntax","Remove or comment out fields not present in the Caffe NetParameter schema you are targeting","Regenerate the prototxt with the matching Caffe version (fields must exist in the schema the library bundles)","Switch loaders if the file is actually another format"],"exampleFix":"# before\ninput_shape: { dim: 1 dim: 3 dim: 224 dim: 224 }\ninput: \"data\"\n\n# after\ninput: \"data\"\ninput_dim: 1\ninput_dim: 3\ninput_dim: 224\ninput_dim: 224","handlingStrategy":"try-catch","validationCode":"// Pre-check prototxt keys against the schema before loading\nconst known = new Set(['name','input','input_dim','layer','layers','state','phase',/* ...*/]);\nfor (const line of prototxt.split('\\n')) {\n  const m = line.match(/^\\s*([a-z_\\d]+)\\s*[:{]/);\n  if (m && !known.has(m[1])) console.warn('Unknown field', m[1]);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await context.open(file);\n} catch (e) {\n  if (/Unknown field/.test(e.message)) {\n    // e.message includes location(); jump user to that line for editing\n    highlightLine(e.message);\n  } else throw e;\n}","preventionTips":["Lint prototxt files against the target Caffe schema before loading","Generate prototxt programmatically rather than hand-editing","Pin the Caffe schema version your tooling expects"],"tags":["caffe","prototxt","text-protobuf","unknown-field"],"backgroundTag":"protobuf-unknown-field","analyzedSha":"d8a543f5f847ef596aa58858d6adcf5d75545f7f","analyzedAt":"2026-08-27T19:21:42.082Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}