这个周末我第一次开始使用Deeplearning4j。我查看了https://deeplearning4j.org/docs/latest/deeplearning4j-quickstart上的页面,看到了“没有Maven的Eclipse设置”的选项。由于我曾经使用过Eclipse,并且以前从未听说过Maven,所以我决定按照这些说明进行操作。
设置后,我在YouTube上找到了一个教程,但是当我运行该项目时,出现此错误:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopenblas in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:945)
at org.bytedeco.javacpp.Loader.load(Loader.java:750)
at org.bytedeco.javacpp.Loader.load(Loader.java:657)
at org.bytedeco.javacpp.openblas.<clinit>(openblas.java:10)
at org.nd4j.linalg.cpu.nativecpu.blas.CpuBlas.setMaxThreads(CpuBlas.java:87)
at org.nd4j.nativeblas.Nd4jBlas.<init>(Nd4jBlas.java:36)
at org.nd4j.linalg.cpu.nativecpu.blas.CpuBlas.<init>(CpuBlas.java:11)
at org.nd4j.linalg.cpu.nativecpu.CpuNDArrayFactory.createBlas(CpuNDArrayFactory.java:79)
at org.nd4j.linalg.factory.BaseNDArrayFactory.blas(BaseNDArrayFactory.java:71)
at org.nd4j.linalg.cpu.nativecpu.blas.CpuLevel3.<init>(CpuLevel3.java:26)
at org.nd4j.linalg.cpu.nativecpu.CpuNDArrayFactory.createLevel3(CpuNDArrayFactory.java:94)
at org.nd4j.linalg.factory.BaseNDArrayFactory.level3(BaseNDArrayFactory.java:92)
at org.nd4j.linalg.factory.BaseBlasWrapper.level3(BaseBlasWrapper.java:42)
at org.nd4j.linalg.api.ndarray.BaseNDArray.mmuli(BaseNDArray.java:2849)
at org.nd4j.linalg.api.ndarray.BaseNDArray.mmul(BaseNDArray.java:2643)
at org.deeplearning4j.nn.layers.BaseLayer.preOutput(BaseLayer.java:373)
at org.deeplearning4j.nn.layers.BaseLayer.activate(BaseLayer.java:384)
at org.deeplearning4j.nn.layers.BaseLayer.activate(BaseLayer.java:405)
at org.deeplearning4j.nn.multilayer.MultiLayerNetwork.activationFromPrevLayer(MultiLayerNetwork.java:590)
at org.deeplearning4j.nn.multilayer.MultiLayerNetwork.feedForwardToLayer(MultiLayerNetwork.java:713)
at org.deeplearning4j.nn.multilayer.MultiLayerNetwork.computeGradientAndScore(MultiLayerNetwork.java:1821)
at org.deeplearning4j.optimize.solvers.BaseOptimizer.gradientAndScore(BaseOptimizer.java:151)
at org.deeplearning4j.optimize.solvers.StochasticGradientDescent.optimize(StochasticGradientDescent.java:54)
at org.deeplearning4j.optimize.Solver.optimize(Solver.java:51)
at org.deeplearning4j.nn.multilayer.MultiLayerNetwork.fit(MultiLayerNetwork.java:1031)
at Tester.main(Tester.java:96)
Caused by: java.lang.UnsatisfiedLinkError: no openblas in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:945)
at org.bytedeco.javacpp.Loader.load(Loader.java:738)
... 24 more
答案 0 :(得分:0)
您似乎缺少Deeplearning4J正常运行所需的.dll(Windows)或.so(Linux)文件。您可以通过下载它们并将其添加到您的类路径来修复它。通过选择项目,单击Build path
,单击Configure build bath
,单击Source
,然后将Native library location
更改为.dll或.so文件所在的文件夹,可以在Eclipse中完成此操作。已下载到。