我是神经网络和 NLP 的新手。我找到了这个库:DeepLearning4J。我试图让它工作,但每当我执行这个指令时:
Collection<String> similar = vec.wordsNearest("word_to_search", 10);
如果我正在搜索的单词被映射到网络中,我会得到以下异常:
java.lang.IllegalArgumentException: XERBLA: Error on argument 6 (LDA) in SGEMV
at org.jblas.NativeBlas.sgemv(Native Method)
at org.nd4j.linalg.jblas.blas.JblasLevel2.sgemv(JblasLevel2.java:25)
at org.nd4j.linalg.api.blas.impl.BaseLevel2.gemv(BaseLevel2.java:53)
at org.nd4j.linalg.api.ndarray.BaseNDArray.mmuli(BaseNDArray.java:2569)
at org.nd4j.linalg.api.ndarray.BaseNDArray.mmul(BaseNDArray.java:2377)
at org.deeplearning4j.models.embeddings.wordvectors.WordVectorsImpl.wordsNearest(WordVectorsImpl.java:290)
at org.deeplearning4j.models.embeddings.wordvectors.WordVectorsImpl.wordsNearest(WordVectorsImpl.java:337)
at word2vec.Word2VecTest.main(Word2VecTest.java:74)
Exception in thread "main" java.lang.NoSuchMethodError: org.nd4j.linalg.api.ndarray.INDArray.mean(I)Lorg/nd4j/linalg/api/ndarray/INDArray;
at org.deeplearning4j.models.embeddings.wordvectors.WordVectorsImpl.wordsNearest(WordVectorsImpl.java:283)
at word2vec.Word2VecTest.main(Word2VecTest.java:89)
我知道 NoSuchMethodError 可能是由于库版本不同。在这种特定情况下,这可能是由 nd4j 引起的。我已经检查了很多版本,这就是我目前正在导入的内容:
- akka-actor_2.11-2.4-M3.jar
- akka-cluster_2.11-2.4-M3.jar
- akka-remote_2.11-2.4-M3.jar
- akka-slf4j_2.11-2.4-M3.jar
- byte-buddy-0.6.15.jar
- config-1.3.0.jar
- deeplearning4j-core-0.0.3.3.4.alpha2.jar
- deeplearning4j-nlp-0.0.3.3.4.alpha2.jar
- deeplearning4j-scaleout-akka-0.0.3.3.4.alpha2.jar
- deeplearning4j-ui-0.0.3.3.4.alpha2.jar
- javassist-3.12.1.GA.jar
- jblas-1.2.4.jar
- jcublas-6.5.jar
- lucene-analyzers-common-4.10.3.jar
- lucene-core-4.10.3.jar
- nd4j-api-0.4-rc3.4.jar
- nd4j-bytebuddy-0.4-rc3.4.jar
- nd4j-jblas-0.4-rc3.4.jar
- nd4j-jcublas-common-0.4-rc3.4.jar
- netty-3.10.4.Final.jar
- protobuf-java-2.6.1.jar
- 反射-0.9.10.jar
- scala-library-2.12.0-M2.jar
- selenium-server-standalone-2.47.1.jar
有人可以向我解释这个问题吗?