stanfordnlp/CoreNLP · error · RuntimeException
No tune treebank path specified...
Error message
No tune treebank path specified...
What it means
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.
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
Example fix
// before
String[] args = {"-tuneFilter", "regex:.*02.*", "-treebank", "/data/ptb"}; // tune opts processed first
// after
String[] args = {"-tuneTreebank", "/data/ptb/wsj/02", "-treebank", "/data/ptb"}; Defensive patterns
Strategy: validation
Validate before calling
// Before invoking the constructor: verify tune options carry a path
if ((tuneFilter != null || tuneTreebankFlag) && tunePath == null && treebankPath == null)
throw new IllegalArgumentException("-tuneTreebank (or -treebank before tune options) is required"); Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Error: No training file provided in properties or via…
- Error: No dest file provided in properties or via command…
- Error: No training file provided in properties or via…
- Error: -train option must have treebankPath as first…
- Error: -train option must have treebankPath as first…
AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10).
Data as JSON: /api/errors/3997f8564668bdd2.
Report an issue: GitHub.
Appendix: source
Thrown at src/edu/stanford/nlp/parser/lexparser/LexicalizedParser.java:1316
} else if (args[argIndex].equalsIgnoreCase("-tune")) {
Pair<String, FileFilter> treebankDescription = ArgUtils.getTreebankDescription(args, argIndex, "-tune");
argIndex = argIndex + ArgUtils.numSubArgs(args, argIndex) + 1;
tunePath = treebankDescription.first();
tuneFilter = treebankDescription.second();
} else {
int oldIndex = argIndex;
argIndex = op.setOptionOrWarn(args, argIndex);
optionArgs.addAll(Arrays.asList(args).subList(oldIndex, argIndex));
}
} // end while loop through arguments
// all other arguments are order dependent and
// are processed in order below
if (tuneFilter != null || tunePath != null) {
if (tunePath == null) {
if (treebankPath == null) {
throw new RuntimeException("No tune treebank path specified...");
} else {
log.info("No tune treebank path specified. Using train path: \"" + treebankPath + '\"');
tunePath = treebankPath;
}
}
tuneTreebank = op.tlpParams.testMemoryTreebank();
tuneTreebank.loadPath(tunePath, tuneFilter);
}
if (!train && op.testOptions.verbose) {
StringUtils.logInvocationString(log, args);
}
LexicalizedParser lp; // always initialized in next if-then-else block
if (train) {
StringUtils.logInvocationString(log, args);
// so we train a parser using the treebank
GrammarCompactor compactor = null;View on GitHub (pinned to 1b7edd19c4)