{"action":"created","issue":{"url":"https://api.github.com/repos/deeplearning4j/nd4j/issues/1922","repository_url":"https://api.github.com/repos/deeplearning4j/nd4j","labels_url":"https://api.github.com/repos/deeplearning4j/nd4j/issues/1922/labels{/name}","comments_url":"https://api.github.com/repos/deeplearning4j/nd4j/issues/1922/comments","events_url":"https://api.github.com/repos/deeplearning4j/nd4j/issues/1922/events","html_url":"https://github.com/deeplearning4j/nd4j/issues/1922","id":241094649,"number":1922,"title":"nd4j related FATAL EXCEPTION encountered while trying to run dl4j on Android","user":{"login":"Yu-Hang","id":5137261,"avatar_url":"https://avatars0.githubusercontent.com/u/5137261?v=3","gravatar_id":"","url":"https://api.github.com/users/Yu-Hang","html_url":"https://github.com/Yu-Hang","followers_url":"https://api.github.com/users/Yu-Hang/followers","following_url":"https://api.github.com/users/Yu-Hang/following{/other_user}","gists_url":"https://api.github.com/users/Yu-Hang/gists{/gist_id}","starred_url":"https://api.github.com/users/Yu-Hang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yu-Hang/subscriptions","organizations_url":"https://api.github.com/users/Yu-Hang/orgs","repos_url":"https://api.github.com/users/Yu-Hang/repos","events_url":"https://api.github.com/users/Yu-Hang/events{/privacy}","received_events_url":"https://api.github.com/users/Yu-Hang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-07-06T21:41:38Z","updated_at":"2017-07-11T12:31:13Z","closed_at":null,"body":"#### Issue Description\r\n\r\nI was trying to run dl4j on Android. I followed the tutorial on [Here](https://deeplearning4j.org/android). The build was successful. However, there was a fatal exception when I ran the app. \r\n\r\nPlease describe your issue, along with:\r\n- expected behavior: app run through\r\n- encountered behavior: fatal execption\r\n\r\n#### Version Information\r\n\r\nPlease indicate relevant versions, including, if relevant:\r\n\r\n* Deeplearning4j version: 0.7.2\r\n* platform information (OS, etc): Android\r\n* CUDA version, if used\r\n* NVIDIA driver version, if in use\r\n\r\n#### Contributing\r\n\r\n```\r\nFile NNfilePath = new File(Environment.getExternalStorageDirectory()+\"/trained_model.zip\");\r\n\r\n        //load the trained weights to the CNN classifier\r\n        try {\r\n            MultiLayerNetwork model = ModelSerializer.restoreMultiLayerNetwork(NNfilePath);\r\n        } catch (IOException e) {\r\n            e.printStackTrace();\r\n        }\r\n```\r\n```\r\n`07-06 17:29:14.193 19488-19488/com.yuh5.nih.testall W/System.err: SLF4J: Failed to load class \"org.slf4j.impl.StaticLoggerBinder\".\r\n07-06 17:29:14.193 19488-19488/com.yuh5.nih.testall W/System.err: SLF4J: Defaulting to no-operation (NOP) logger implementation\r\n07-06 17:29:14.193 19488-19488/com.yuh5.nih.testall W/System.err: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.\r\n07-06 17:29:14.263 19488-19498/com.yuh5.nih.testall I/art: Background partial concurrent mark sweep GC freed 18098(12MB) AllocSpace objects, 10(24MB) LOS objects, 54% free, 13MB/29MB, paused 6.799ms total 83.079ms\r\n07-06 17:29:14.353 19488-19488/com.yuh5.nih.testall D/AndroidRuntime: Shutting down VM\r\n07-06 17:29:14.353 19488-19488/com.yuh5.nih.testall E/AndroidRuntime: FATAL EXCEPTION: main\r\n                                                                      Process: com.yuh5.nih.testall, PID: 19488\r\n                                                                      java.lang.ExceptionInInitializerError\r\n                                                                          at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.<init>(NativeOpExecutioner.java:41)\r\n                                                                          at java.lang.Class.newInstance(Native Method)\r\n                                                                          at org.nd4j.linalg.factory.Nd4j.initWithBackend(Nd4j.java:5646)\r\n                                                                          at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5554)\r\n                                                                          at org.nd4j.linalg.factory.Nd4j.<clinit>(Nd4j.java:189)\r\n                                                                          at org.deeplearning4j.util.ModelSerializer.restoreMultiLayerNetwork(ModelSerializer.java:216)\r\n                                                                          at org.deeplearning4j.util.ModelSerializer.restoreMultiLayerNetwork(ModelSerializer.java:167)\r\n                                                                          at com.yuh5.nih.testall.NeuralNetwork.<init>(NeuralNetwork.java:33)\r\n                                                                          at com.yuh5.nih.testall.Cells.<init>(Cells.java:209)\r\n                                                                          at com.yuh5.nih.testall.MainActivity.processImage(MainActivity.java:363)\r\n                                                                          at com.yuh5.nih.testall.MainActivity$1.onClick(MainActivity.java:243)\r\n                                                                          at android.view.View.performClick(View.java:5697)\r\n                                                                          at android.widget.TextView.performClick(TextView.java:10815)\r\n                                                                          at android.view.View$PerformClick.run(View.java:22526)\r\n                                                                          at android.os.Handler.handleCallback(Handler.java:739)\r\n                                                                          at android.os.Handler.dispatchMessage(Handler.java:95)\r\n                                                                          at android.os.Looper.loop(Looper.java:158)\r\n                                                                          at android.app.ActivityThread.main(ActivityThread.java:7229)\r\n                                                                          at java.lang.reflect.Method.invoke(Native Method)\r\n                                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)\r\n                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)\r\n                                                                       Caused by: java.lang.RuntimeException: ND4J is probably missing dependencies. For more information, please refer to: http://nd4j.org/getstarted.html\r\n                                                                          at org.nd4j.nativeblas.NativeOpsHolder.<init>(NativeOpsHolder.java:40)\r\n                                                                          at org.nd4j.nativeblas.NativeOpsHolder.<clinit>(NativeOpsHolder.java:16)\r\n                                                                          at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.<init>(NativeOpExecutioner.java:41) \r\n                                                                          at java.lang.Class.newInstance(Native Method) \r\n                                                                          at org.nd4j.linalg.factory.Nd4j.initWithBackend(Nd4j.java:5646) \r\n                                                                          at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5554) \r\n                                                                          at org.nd4j.linalg.factory.Nd4j.<clinit>(Nd4j.java:189) \r\n                                                                          at org.deeplearning4j.util.ModelSerializer.restoreMultiLayerNetwork(ModelSerializer.java:216) \r\n                                                                          at org.deeplearning4j.util.ModelSerializer.restoreMultiLayerNetwork(ModelSerializer.java:167) \r\n                                                                          at com.yuh5.nih.testall.NeuralNetwork.<init>(NeuralNetwork.java:33) \r\n                                                                          at com.yuh5.nih.testall.Cells.<init>(Cells.java:209) \r\n                                                                          at com.yuh5.nih.testall.MainActivity.processImage(MainActivity.java:363) \r\n                                                                          at com.yuh5.nih.testall.MainActivity$1.onClick(MainActivity.java:243) \r\n                                                                          at android.view.View.performClick(View.java:5697) \r\n                                                                          at android.widget.TextView.performClick(TextView.java:10815) \r\n                                                                          at android.view.View$PerformClick.run(View.java:22526) \r\n                                                                          at android.os.Handler.handleCallback(Handler.java:739) \r\n                                                                          at android.os.Handler.dispatchMessage(Handler.java:95) \r\n                                                                          at android.os.Looper.loop(Looper.java:158) \r\n                                                                          at android.app.ActivityThread.main(ActivityThread.java:7229) \r\n                                                                          at java.lang.reflect.Method.invoke(Native Method) \r\n                                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) \r\n                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) \r\n                                                                       Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file \"/data/app/com.yuh5.nih.testall-2/base.apk\"],nativeLibraryDirectories=[/data/app/com.yuh5.nih.testall-2/lib/arm, /data/app/com.yuh5.nih.testall-2/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]] couldn't find \"libjnind4jcpu.so\"\r\n                                                                          at java.lang.Runtime.loadLibrary(Runtime.java:367)\r\n                                                                          at java.lang.System.loadLibrary(System.java:1076)\r\n                                                                          at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:945)\r\n                                                                          at org.bytedeco.javacpp.Loader.load(Loader.java:750)\r\n                                                                          at org.bytedeco.javacpp.Loader.load(Loader.java:657)\r\n                                                                          at org.nd4j.nativeblas.Nd4jCpu.<clinit>(Nd4jCpu.java:10)\r\n                                                                          at java.lang.Class.classForName(Native Method)\r\n                                                                          at java.lang.Class.forName(Class.java:324)\r\n                                                                          at org.bytedeco.javacpp.Loader.load(Loader.java:712)\r\n                                                                          at org.bytedeco.javacpp.Loader.load(Loader.java:657)\r\n                                                                          at org.nd4j.nativeblas.Nd4jCpu$NativeOps.<clinit>(Nd4jCpu.java:54)\r\n                                                                          at java.lang.Class.classForName(Native Method)\r\n                                                                          at java.lang.Class.forName(Class.java:324)\r\n                                                                          at java.lang.Class.forName(Class.java:285)\r\n                                                                          at org.nd4j.nativeblas.NativeOpsHolder.<init>(NativeOpsHolder.java:23)\r\n                                                                          at org.nd4j.nativeblas.NativeOpsHolder.<clinit>(NativeOpsHolder.java:16) \r\n                                                                          at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.<init>(NativeOpExecutioner.java:41) \r\n                                                                          at java.lang.Class.newInstance(Native Method) \r\n                                                                          at org.nd4j.linalg.factory.Nd4j.initWithBackend(Nd4j.java:5646) \r\n                                                                          at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5554) \r\n                                                                          at org.nd4j.linalg.factory.Nd4j.<clinit>(Nd4j.java:189) \r\n                                                                          at org.deeplearning4j.util.ModelSerializer.restoreMultiLayerNetwork(ModelSerializer.java:216) \r\n                                                                          at org.deeplearning4j.util.ModelSerializer.restoreMultiLayerNetwork(ModelSerializer.java:167) \r\n                                                                          at com.yuh5.nih.testall.NeuralNetwork.<init>(NeuralNetwork.java:33) \r\n                                                                          at com.yuh5.nih.testall.Cells.<init>(Cells.java:209) \r\n                                                                          at com.yuh5.nih.testall.MainActivity.processImage(MainActivity.java:363) \r\n                                                                          at com.yuh5.nih.testall.MainActivity$1.onClick(MainActivity.java:243) \r\n                                                                          at android.view.View.performClick(View.java:5697) \r\n                                                                          at android.widget.TextView.performClick(TextView.java:10815) \r\n                                                                          at android.view.View$PerformClick.run(View.java:22526) \r\n                                                                          at android.os.Handler.handleCallback(Handler.java:739) \r\n                                                                          at android.os.Handler.dispatchMessage(Handler.java:95) \r\n                                                                          at android.os.Looper.loop(Looper.java:158) \r\n                                                                          at android.app.ActivityThread.main(ActivityThread.java:7229) \r\n                                                                          at java.lang.reflect.Method.invoke(Native Method) \r\n                                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) \r\n                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) \r\n                                                                       Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file \"/data/app/com.yuh5.nih.testall-2/base.apk\"],nativeLibraryDirectories=[/data/app/com.yuh5.nih.testall-2/lib/arm, /data/app/com.yuh5.nih.testall-2/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]] couldn't find \"libnd4jcpu.so\"\r\n                                                                          at java.lang.Runtime.loadLibrary(Runtime.java:367)\r\n                                                                          at java.lang.System.loadLibrary(System.java:1076)\r\n                                                                          at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:945)\r\n                                                                          at org.bytedeco.javacpp.Loader.load(Loader.java:738)\r\n                                                                          at org.bytedeco.javacpp.Loader.load(Loader.java:657) \r\n                                                                          at org.nd4j.nativeblas.Nd4jCpu.<clinit>(Nd4jCpu.java:10) \r\n                                                                          at java.lang.Class.classForName(Native Method) \r\n                                                                          at java.lang.Class.forName(Class.java:324) \r\n                                                                          at org.bytedeco.javacpp.Loader.load(Loader.java:712) \r\n                                                                          at org.bytedeco.javacpp.Loader.load(Loader.java:657) \r\n                                                                          at org.nd4j.nativeblas.Nd4jCpu$NativeOps.<clinit>(Nd4jCpu.java:54) \r\n                                                                          at java.lang.Class.classForName(Native Method) \r\n                                                                          at java.lang.Class.forName(Class.java:324) \r\n                                                                          at java.lang.Class.forName(Class.java:285) \r\n                                                                          at org.nd4j.nativeblas.NativeOpsHolder.<init>(NativeOpsHolder.java:23) \r\n                                                                          at org.nd4j.nativeblas.NativeOpsHolder.<clinit>(NativeOpsHolder.java:16) \r\n                                                                          at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.<init>(NativeOpExecutioner.java:41) \r\n                                                                          at java.lang.Class.newInstance(Native Method) \r\n                                                                          at org.nd4j.linalg.factory.Nd4j.initWithBackend(Nd4j.java:5646) \r\n                                                                          at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5554) \r\n                                                                          at org.nd4j.linalg.factory.Nd4j.<clinit>(Nd4j.java:189) \r\n                                                                          at org.deeplearning4j.util.ModelSerializer.restoreMultiLayerNetwork(ModelSerializer.java:216) \r\n                                                                          at org.deeplearning4j.util.ModelSerializer.restoreMultiLayerNetwork(ModelSerializer.java:167) \r\n                                                                          at com.yuh5.nih.testall.NeuralNetwork.<init>(NeuralNetwork.java:33) \r\n                                                                          at com.yuh5.nih.testall.Cells.<init>(Cells.java:209) \r\n                                                                          at com.yuh5.nih.testall.MainActivity.processImage(MainActivity.java:363) \r\n                                                                          at com.yuh5.nih.testall.MainActivity$1.onClick(MainActivity.java:243) \r\n                                                                          at android.view.View.performClick(View.java:5697) \r\n                                                                          at android.widget.TextView.performClick(TextView.java:10815) \r\n                                                                          at android.view.View$PerformClick.run(View.java:22526) \r\n                                                                          at android.os.Handler.handleCallback(Handler.java:739) \r\n                                                                          at android.os.Handler.dispatchMessage(Handler.java:95) \r\n                                                                          at android.os.Looper.loop(Looper.java:158) \r\n                                                                          at android.app.ActivityThread.main(ActivityThread.java:7229) \r\n                                                                          at java.lang.reflect.Method.invoke(Native Method) \r\n                                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) \r\n                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) `\r\n```\r\nGradle:\r\nProject:\r\n```\r\n// Top-level build file where you can add configuration options common to all sub-projects/modules.\r\n\r\nbuildscript {\r\n    repositories {\r\n        mavenCentral()\r\n        jcenter()\r\n    }\r\n    dependencies {\r\n        classpath 'com.android.tools.build:gradle:2.3.1'\r\n\r\n        // NOTE: Do not place your application dependencies here; they belong\r\n        // in the individual module build.gradle files\r\n    }\r\n}\r\n\r\nallprojects {\r\n    repositories {\r\n        mavenCentral()\r\n        jcenter()\r\n    }\r\n}\r\n\r\ntask clean(type: Delete) {\r\n    delete rootProject.buildDir\r\n}\r\n```\r\nApp:\r\n```\r\napply plugin: 'com.android.application'\r\n\r\nandroid {\r\n    compileSdkVersion 23\r\n    buildToolsVersion \"25.0.1\"\r\n\r\n    defaultConfig {\r\n        applicationId \"com.yuh5.nih.testall\"\r\n        minSdkVersion 19\r\n        targetSdkVersion 23\r\n        versionCode 1\r\n        versionName \"1.0\"\r\n        multiDexEnabled true\r\n    }\r\n    buildTypes {\r\n        release {\r\n            minifyEnabled false\r\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\r\n        }\r\n    }\r\n    packagingOptions {\r\n        exclude 'META-INF/DEPENDENCIES'\r\n        exclude 'META-INF/DEPENDENCIES.txt'\r\n        exclude 'META-INF/LICENSE'\r\n        exclude 'META-INF/LICENSE.txt'\r\n        exclude 'META-INF/license.txt'\r\n        exclude 'META-INF/NOTICE'\r\n        exclude 'META-INF/NOTICE.txt'\r\n        exclude 'META-INF/notice.txt'\r\n        exclude 'META-INF/INDEX.LIST'\r\n    }\r\n}\r\n\r\ndependencies {\r\n    compile fileTree(include: ['*.jar'], dir: 'libs')\r\n    testCompile 'junit:junit:4.12'\r\n    compile 'com.android.support:appcompat-v7:23.2.1'\r\n    compile project(':libraries:opencv')\r\n    compile 'org.deeplearning4j:deeplearning4j-core:0.7.2'\r\n    compile 'org.nd4j:nd4j-native:0.7.2'\r\n    compile 'org.nd4j:nd4j-native:0.7.2:android-x86'\r\n    compile 'org.nd4j:nd4j-native:0.7.2:android-arm'\r\n}\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/deeplearning4j/nd4j/issues/comments/314428478","html_url":"https://github.com/deeplearning4j/nd4j/issues/1922#issuecomment-314428478","issue_url":"https://api.github.com/repos/deeplearning4j/nd4j/issues/1922","id":314428478,"user":{"login":"saudet","id":3328023,"avatar_url":"https://avatars2.githubusercontent.com/u/3328023?v=3","gravatar_id":"","url":"https://api.github.com/users/saudet","html_url":"https://github.com/saudet","followers_url":"https://api.github.com/users/saudet/followers","following_url":"https://api.github.com/users/saudet/following{/other_user}","gists_url":"https://api.github.com/users/saudet/gists{/gist_id}","starred_url":"https://api.github.com/users/saudet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saudet/subscriptions","organizations_url":"https://api.github.com/users/saudet/orgs","repos_url":"https://api.github.com/users/saudet/repos","events_url":"https://api.github.com/users/saudet/events{/privacy}","received_events_url":"https://api.github.com/users/saudet/received_events","type":"User","site_admin":false},"created_at":"2017-07-11T12:31:13Z","updated_at":"2017-07-11T12:31:13Z","body":"Just standard Android stuff, we need to pickFirst or exclude as explained on https://deeplearning4j.org/android"}}
{"actor":{"display_login":"saudet"}}