我正在尝试使用Stanford依赖解析器。我尝试在Windows上从命令行运行解析器以使用此命令提取依赖项:
java -mx100m -cp "stanford-parser.jar" edu.stanford.nlp.trees.EnglishGrammaticalStructure -sentFile english-onesent.txt -collapsedTree -CCprocessed -parserFile englishPCFG.ser.gz
我收到以下错误:
Error occurred during initialization of VM
Too small initial heap
我将内存大小更改为-mx1024,-mx2048以及-mx4096。它没有改变任何东西,错误仍然存在。
我错过了什么?
答案 0 :(得分:6)
应该是-mx1024 m 。我跳过 m 。
还有一件事:在-cp中,还应该包含模型jar。
... -cp "stanford-parser.jar;stanford-parser-3.5.2-models.jar"...
(假设您使用的是最新版本)。
否则将抛出IO异常。
答案 1 :(得分:4)
键入-Xmx1024m
而不是-mx1024
。
请参阅https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html
答案 2 :(得分:0)
IDE中可能预先存在一些参数。 在日食中: 转到->运行方式->运行配置->参数 然后删除以前使用的参数。 重新开始蚀。 为我工作!