我正在尝试使用以下代码加载 Google 新闻语料库:
File gModel = new File("/word2vec/GoogleNews-vectors-negative300.bin.gz");
Word2Vec vec = WordVectorSerializer.loadGoogleModel(gModel, true);
但这会导致此错误:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
我尝试更改 VM 选项参数,就像在 deeplearning4j 的官方文档中解释的那样:
-Xms1024m -Xmx10g -XX:MaxPermSize=2g