javaunsatisfiedlinkerroropenblasdl4j

DL4J UnsatisfiedLinkError: no jniopenblas in java.library.path


I tried to set up a deeplearning4j project via gradle, but I get an UnsatisfiedLinkError:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopenblas in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
    at java.lang.Runtime.loadLibrary0(Runtime.java:870)
    at java.lang.System.loadLibrary(System.java:1122)
    at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:976)
    at org.bytedeco.javacpp.Loader.load(Loader.java:777)
    at org.bytedeco.javacpp.Loader.load(Loader.java:684)
    at org.bytedeco.javacpp.openblas.<clinit>(openblas.java:10)
    at org.nd4j.linalg.cpu.nativecpu.blas.CpuBlas.setMaxThreads(CpuBlas.java:117)
    at org.nd4j.nativeblas.Nd4jBlas.<init>(Nd4jBlas.java:35)
    at org.nd4j.linalg.cpu.nativecpu.blas.CpuBlas.<init>(CpuBlas.java:12)
    at org.nd4j.linalg.cpu.nativecpu.CpuNDArrayFactory.createBlas(CpuNDArrayFactory.java:89)
    at org.nd4j.linalg.factory.BaseNDArrayFactory.blas(BaseNDArrayFactory.java:67)
    at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.getEnvironmentInformation(NativeOpExecutioner.java:1176)
    at org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner.printEnvironmentInformation(DefaultOpExecutioner.java:562)
    at org.nd4j.linalg.factory.Nd4j.initWithBackend(Nd4j.java:6210)
    at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:6087)
    at org.nd4j.linalg.factory.Nd4j.<clinit>(Nd4j.java:201)
    at org.deeplearning4j.nn.conf.NeuralNetConfiguration$Builder.seed(NeuralNetConfiguration.java:777)
    at my.project.NeuralNetwork.main(NeuralNetwork.java:43)
Caused by: java.lang.UnsatisfiedLinkError: no openblas in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
    at java.lang.Runtime.loadLibrary0(Runtime.java:870)
    at java.lang.System.loadLibrary(System.java:1122)
    at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:976)
    at org.bytedeco.javacpp.Loader.load(Loader.java:765)
    ... 14 more

My dependencies look like:

dependencies {
    compile group: 'org.deeplearning4j', name: 'deeplearning4j-core', version: '0.9.1'
    compile group: 'org.deeplearning4j', name: 'rl4j', version: '0.9.1'
    compile group: 'org.nd4j', name: 'nd4j-native', version: '0.9.1'
    compile group: 'org.nd4j', name: 'nd4j-jblas', version: '0.9.1'
    compile group: 'org.nd4j', name: 'nd4j-api', version: '0.9.1'
    compile 'org.nd4j:nd4j-native:0.9.1:windows-x86_64'
}

I've also tried to add

compile group: 'org.bytedeco.javacpp-presets', name: 'openblas', version: '0.2.20-1.3'

but that didn't help.

Do I need to install OpenBlas? I didn't read such a thing in the Quick Start Guide for deeplearning4j. OS is Win10, IDE is IntelliJ Community Edition.


Solution

  • nd4j-jblas isn't even a valid maven dependency. Where did you get that from exactly?

    We don't have nd4j-jblas anywhere in our docs and it hasn't existed for nearly 2 years now. Stick to our getting started docs: http://deeplearning4j.org/quickstart

    We explain what you need in there. Rather than messing with all the classifiers just use: nd4j-native-platform for the artifact id.