{"record":{"id":"3997f8564668bdd2","repo":"stanfordnlp/CoreNLP","slug":"no-tune-treebank-path-specified","errorCode":null,"errorMessage":"No tune treebank path specified...","messagePattern":"No tune treebank path specified\\.\\.\\.","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/parser/lexparser/LexicalizedParser.java","lineNumber":1316,"sourceCode":"      } else if (args[argIndex].equalsIgnoreCase(\"-tune\")) {\n        Pair<String, FileFilter> treebankDescription = ArgUtils.getTreebankDescription(args, argIndex, \"-tune\");\n        argIndex = argIndex + ArgUtils.numSubArgs(args, argIndex) + 1;\n        tunePath = treebankDescription.first();\n        tuneFilter = treebankDescription.second();\n      } else {\n        int oldIndex = argIndex;\n        argIndex = op.setOptionOrWarn(args, argIndex);\n        optionArgs.addAll(Arrays.asList(args).subList(oldIndex, argIndex));\n      }\n    } // end while loop through arguments\n\n    // all other arguments are order dependent and\n    // are processed in order below\n\n    if (tuneFilter != null || tunePath != null) {\n      if (tunePath == null) {\n        if (treebankPath == null) {\n          throw new RuntimeException(\"No tune treebank path specified...\");\n        } else {\n          log.info(\"No tune treebank path specified.  Using train path: \\\"\" + treebankPath + '\\\"');\n          tunePath = treebankPath;\n        }\n      }\n      tuneTreebank = op.tlpParams.testMemoryTreebank();\n      tuneTreebank.loadPath(tunePath, tuneFilter);\n    }\n\n    if (!train && op.testOptions.verbose) {\n      StringUtils.logInvocationString(log, args);\n    }\n    LexicalizedParser lp; // always initialized in next if-then-else block\n    if (train) {\n      StringUtils.logInvocationString(log, args);\n\n      // so we train a parser using the treebank\n      GrammarCompactor compactor = null;","sourceCodeStart":1298,"sourceCodeEnd":1334,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/parser/lexparser/LexicalizedParser.java#L1298-L1334","documentation":"In the order-dependent LexicalizedParser constructor used for training/tuning, a tuning filter or tune path was supplied but tunePath itself was null and no treebankPath (train path) had yet been parsed, so there is nothing to default the tuning set to. The constructor throws \"No tune treebank path specified...\" to signal the required argument is missing.","triggerScenarios":"Passing -tuneFilter (or a tuneTreebank flag) on the command line / to the constructor without also passing a -tuneTreebank path, and before any -treebank argument that could serve as the default.","commonSituations":"Building a custom training command and adding a tune filter copied from an example but forgetting -tuneTreebank; argument ordering mistakes so treebankPath is still null when the tune options are processed.","solutions":["Add a -tuneTreebank <path> argument (with optional filter) to your training command","Or pass -treebank <trainPath> BEFORE the tune options so tunePath can default to the train path","If you don't need tuning, drop the tune filter/flags entirely"],"exampleFix":"// before\nString[] args = {\"-tuneFilter\", \"regex:.*02.*\", \"-treebank\", \"/data/ptb\"}; // tune opts processed first\n// after\nString[] args = {\"-tuneTreebank\", \"/data/ptb/wsj/02\", \"-treebank\", \"/data/ptb\"};","handlingStrategy":"validation","validationCode":"// Before invoking the constructor: verify tune options carry a path\nif ((tuneFilter != null || tuneTreebankFlag) && tunePath == null && treebankPath == null)\n  throw new IllegalArgumentException(\"-tuneTreebank (or -treebank before tune options) is required\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass -tuneTreebank when using tune filters","Keep -treebank first in order-dependent argument lists","Test training commands with -h to confirm required argument ordering"],"tags":["cli","missing-argument","training","java"],"backgroundTag":"missing-required-argument","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}