deeplearning4j / deeplearning4j-examples

Deeplearning4j Examples (DL4J, DL4J Spark, DataVec)

Home Page:http://deeplearning4j.konduit.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android UnsatisfiedLinkError:library "libXXX.so" not found

Lizhihzzx opened this issue · comments

commented

Issue Description

I want to use deeplearning4j to train nn on Android. I try to run Android-examples. And it occurs problems below.Seems some libs not found.How to integrate them?

W/System.err: Warning: Could not load Loader: java.lang.UnsatisfiedLinkError: dlopen failed: library "libjnijavacpp.so" not found
W/System.err: Warning: Version of org.bytedeco:openblas could not be found.
E/linker: normalize_path - invalid input: "lib/", the input path should be absolute
W/linker: Warning: unable to normalize "lib/" (ignoring)
E/linker: normalize_path - invalid input: "lib/", the input path should be absolute
W/linker: Warning: unable to normalize "lib/" (ignoring)
W/System.err: Warning: Could not load Pointer: java.lang.UnsatisfiedLinkError: dlopen failed: library "libjnijavacpp.so" not found
E/linker: normalize_path - invalid input: "lib/", the input path should be absolute
W/linker: Warning: unable to normalize "lib/" (ignoring)
E/linker: normalize_path - invalid input: "lib/", the input path should be absolute
W/linker: Warning: unable to normalize "lib/" (ignoring)
E/linker: normalize_path - invalid input: "lib/", the input path should be absolute
W/linker: Warning: unable to normalize "lib/" (ignoring)
E/AndroidRuntime: FATAL EXCEPTION: Thread-2
    Process: com.example.androidDl4jClassifier, PID: 9770
    java.lang.ExceptionInInitializerError
        at org.nd4j.nativeblas.NativeOpsHolder.getInstance(NativeOpsHolder.java:119)
        at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.<init>(NativeOpExecutioner.java:86)
        at java.lang.Class.newInstance(Native Method)
        at org.nd4j.linalg.factory.Nd4j.initWithBackend(Nd4j.java:5178)
        at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5092)
        at org.nd4j.linalg.factory.Nd4j.<clinit>(Nd4j.java:270)
        at org.nd4j.linalg.factory.Nd4j.linspace(Nd4j.java:2025)
        at com.example.androidDl4jClassifier.TrainingTask.calcGrid(TrainingTask.java:160)
        at com.example.androidDl4jClassifier.TrainingTask.lambda$executeTask$0$TrainingTask(TrainingTask.java:79)
        at com.example.androidDl4jClassifier.-$$Lambda$TrainingTask$sRph-14nMdC0OGidNCyB0Y5MywA.run(Unknown Source:4)
        at java.lang.Thread.run(Thread.java:923)
     Caused by: java.lang.RuntimeException: ND4J is probably missing dependencies. For more information, please refer to: https://deeplearning4j.konduit.ai/nd4j/backend
        at org.nd4j.nativeblas.NativeOpsHolder.<init>(NativeOpsHolder.java:112)
        at org.nd4j.nativeblas.NativeOpsHolder.<clinit>(NativeOpsHolder.java:35)
        at org.nd4j.nativeblas.NativeOpsHolder.getInstance(NativeOpsHolder.java:119) 
        at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.<init>(NativeOpExecutioner.java:86) 
        at java.lang.Class.newInstance(Native Method) 
        at org.nd4j.linalg.factory.Nd4j.initWithBackend(Nd4j.java:5178) 
        at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5092) 
        at org.nd4j.linalg.factory.Nd4j.<clinit>(Nd4j.java:270) 
        at org.nd4j.linalg.factory.Nd4j.linspace(Nd4j.java:2025) 
        at com.example.androidDl4jClassifier.TrainingTask.calcGrid(TrainingTask.java:160) 
        at com.example.androidDl4jClassifier.TrainingTask.lambda$executeTask$0$TrainingTask(TrainingTask.java:79) 
        at com.example.androidDl4jClassifier.-$$Lambda$TrainingTask$sRph-14nMdC0OGidNCyB0Y5MywA.run(Unknown Source:4) 
        at java.lang.Thread.run(Thread.java:923) 
     Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "libc++_shared.so" not found: needed by /data/app/~~N8YmMTa2ltw6O-DWgCbfCA==/com.example.androidDl4jClassifier-2X9imiyN1THpWOUlKKwTLw==/base.apk!/lib/x86/libnd4jcpu.so in namespace classloader-namespace
        at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
        at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
        at java.lang.System.loadLibrary(System.java:1664)
        at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1631)
        at org.bytedeco.javacpp.Loader.load(Loader.java:1265)
        at org.bytedeco.javacpp.Loader.load(Loader.java:1109)
        at org.nd4j.nativeblas.Nd4jCpu.<clinit>(Nd4jCpu.java:14)
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:454)
        at java.lang.Class.forName(Class.java:379)
        at org.nd4j.nativeblas.NativeOpsHolder.<init>(NativeOpsHolder.java:85)
        at org.nd4j.nativeblas.NativeOpsHolder.<clinit>(NativeOpsHolder.java:35) 
        at org.nd4j.nativeblas.NativeOpsHolder.getInstance(NativeOpsHolder.java:119) 
        at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.<init>(NativeOpExecutioner.java:86) 
        at java.lang.Class.newInstance(Native Method) 
        at org.nd4j.linalg.factory.Nd4j.initWithBackend(Nd4j.java:5178) 
        at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5092) 
        at org.nd4j.linalg.factory.Nd4j.<clinit>(Nd4j.java:270) 
        at org.nd4j.linalg.factory.Nd4j.linspace(Nd4j.java:2025) 
        at com.example.androidDl4jClassifier.TrainingTask.calcGrid(TrainingTask.java:160) 
        at com.example.androidDl4jClassifier.TrainingTask.lambda$executeTask$0$TrainingTask(TrainingTask.java:79) 
        at com.example.androidDl4jClassifier.-$$Lambda$TrainingTask$sRph-14nMdC0OGidNCyB0Y5MywA.run(Unknown Source:4) 
        at java.lang.Thread.run(Thread.java:923) 
     Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "libc++_shared.so" not found: needed by /data/app/~~N8YmMTa2ltw6O-DWgCbfCA==/com.example.androidDl4jClassifier-2X9imiyN1THpWOUlKKwTLw==/base.apk!/lib/x86/libnd4jcpu.so in namespace classloader-namespace
        at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
        at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
        at java.lang.System.loadLibrary(System.java:1664)
        at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1631)
        at org.bytedeco.javacpp.Loader.load(Loader.java:1213)
        at org.bytedeco.javacpp.Loader.load(Loader.java:1109) 
        at org.nd4j.nativeblas.Nd4jCpu.<clinit>(Nd4jCpu.java:14) 
        at java.lang.Class.classForName(Native Method) 
        at java.lang.Class.forName(Class.java:454) 
        at java.lang.Class.forName(Class.java:379) 
        at org.nd4j.nativeblas.NativeOpsHolder.<init>(NativeOpsHolder.java:85) 
        at org.nd4j.nativeblas.NativeOpsHolder.<clinit>(NativeOpsHolder.java:35) 
        at org.nd4j.nativeblas.NativeOpsHolder.getInstance(NativeOpsHolder.java:119) 
        at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.<init>(NativeOpExecutioner.java:86) 
        at java.lang.Class.newInstance(Native Method) 
        at org.nd4j.linalg.factory.Nd4j.initWithBackend(Nd4j.java:5178) 
        at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5092) 
        at org.nd4j.linalg.factory.Nd4j.<clinit>(Nd4j.java:270) 
        at org.nd4j.linalg.factory.Nd4j.linspace(Nd4j.java:2025) 
        at com.example.androidDl4jClassifier.TrainingTask.calcGrid(TrainingTask.java:160) 
        at com.example.androidDl4jClassifier.TrainingTask.lambda$executeTask$0$TrainingTask(TrainingTask.java:79) 
        at com.example.androidDl4jClassifier.-$$Lambda$TrainingTask$sRph-14nMdC0OGidNCyB0Y5MywA.run(Unknown Source:4) 
        at java.lang.Thread.run(Thread.java:923) 

Version Information

Please indicate relevant versions, including, if relevant:

  • Deeplearning4j version 1.0.0-beta7
  • platform information (OS, etc) Android Studio,Windows

Contributing

If you'd like to help us fix the issue by contributing some code, but would
like guidance or help in doing so, please mention it!

This is a known problem with beta7. Try using the snapshots: https://deeplearning4j.konduit.ai/config/config-snapshots

commented

This is a known problem with beta7. Try using the snapshots: https://deeplearning4j.konduit.ai/config/config-snapshots

Thanks.I used a real cellphone and the problems disappears.Maybe it is the problem of emulators of android studio.

Please use the community forums for further communication. Apologies, but this is right at the top of the readme.