user6172474
user6172474

Reputation:

issue when run deeplearning4J example

I am learning deep learning, and use deeplearning4J tuts. But when i run example code, some issue there :

enter image description here

Caused by: java.lang.UnsatisfiedLinkError: no jnind4j 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:727)
    at org.bytedeco.javacpp.Loader.load(Loader.java:502)
    at org.nd4j.nativeblas.NativeOps.<clinit>(NativeOps.java:37)
    ... 18 more

i have tried some solutions on web but it doesnot work. So, if you know how to fix it, help me.

Upvotes: 2

Views: 1487

Answers (3)

Edy Bourne
Edy Bourne

Reputation: 6207

You need to unzip cuda-9.1-7.1-1.4.1-windows-x86_64.jar and nd4j-cuda-9.1-1.0.0-beta-windows-x86_64.jar somewhere, and add the paths to the native dlls to the java.library.path property when launching your app.

For example:

-Djava.library.path=C:\<path where you unzipped>\cuda-9.1-7.1-1.4.1-windows-x86_64\org\bytedeco\javacpp\windows-x86_64;C:\<path where you unzipped>\nd4j-cuda-9.1-1.0.0-beta-windows-x86_64\org\nd4j\nativeblas\windows-x86_64

Upvotes: 2

Aromadz
Aromadz

Reputation: 173

I had the same problem. But the issue was I was using the wrong import , nd4j-native. Instead of that I used nd4j-native-platform import and it fixed the problem. Hope it helps.

Upvotes: 2

Adam Gibson
Adam Gibson

Reputation: 3205

I will try to answer this here, but usually this is where the chat comes in handy (a lot of asking about your environment and back and forth here..)

I'd try to answer this here, but the native code (especially with the examples) should run fine.

You could also try filing an issue: https://github.com/deeplearning4j/dl4j-examples/issues

In the mean time, read up on what an nd4j backend is: http://nd4j.org/backend.html

This SHOULD be the only dependency you need to run: http://search.maven.org/#artifactdetails%7Corg.nd4j%7Cnd4j-native-platform%7C0.6.0%7Cjar

The examples run out of the box for everyone we've talked to.

You don't seem to be doing anything out of the ordinary.

An alternative might just be using the nd4j-native artifact id with the appropriate classifier.

This is where you modify the nd4j backend: https://github.com/deeplearning4j/dl4j-examples/blob/master/dl4j-examples/pom.xml#L64

You can try just getting rid of this and replacing it with 1 of the artifact ids I told you about. If that doesn't fix it, I would recommend coming in to gitter.

Please come in to gitter: https://gitter.im/deeplearning4j/deeplearning4j

for real time help.

Upvotes: -1

Related Questions