lavajaw
November 23, 2020, 5:59pm
1
I have model trained on beta7.
When I try to run that model on beta6 i receive this error:
Caused by: java.lang.RuntimeException: org.nd4j.shade.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: org.deeplearning4j.nn.conf.ComputationGraphConfiguration[“vertices”]->java.util.LinkedHashMap[“output”]->org.deeplearning4j.nn.conf.graph.LayerVertex[“layerConf”]->org.deeplearning4j.nn.conf.NeuralNetConfiguration[“layer”]->org.deeplearning4j.nn.conf.layers.objdetect.Yolo2OutputLayer[“boundingBoxes”])
Reason why I use beta6 is because I need to run that model on android and you currently have problem with android on beta7.
I tried to use snapshots but I cant download org.nd4j:nd4j-native:1.0.0-SNAPSHOT:jar:android-arm64 because it doesn’t exist. So I am stuck on beta6.
Is any workaround for this JsonMappingException - any way to convert model?
Thanks on your time,
Aleksandar
@lavajaw sorry was catching up on posts and found this. If I don’t reply, please do follow up.
When you say “android on beta7” could you clarify that a bit? We have folks running android models.
Could you give us your model? (Even via DM is fine)
lavajaw
November 30, 2020, 10:04am
3
Hello,
After upgrading my dependencies from beta6 to beta7 I receive error on android:
java.lang.ExceptionInInitializerError
at org.nd4j.nativeblas.NativeOpsHolder.getInstance(NativeOpsHolder.java:119)
at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.(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.(…
In that link you can see my problem with beta7 models on android. I tried to use snapshots, but some jars are missing. For example:
https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.nd4j&a=nd4j-native&v=1.0.0-SNAPSHOT&e=jar&c=android-arm64
I think that I saw somewhere that new version will be soon (beta8 ?), but if it isn’t true can you help me with beta7 and android?
Other solution is to somehow fix this JSON error.
Mine model trained for 1 epoch I will provide you in DM.
Thank on your time,
Aleksandar
lavajaw:
receive this e
@lavajaw could you clarify the problem with dl4j on beta7 with android? I don’t see that issue in this thread, looking at the model, beta7 change a few things meaning no backwards compatibility there. Ideally we troubleshoot this with more recent versions.
@saudet may have context here I don’t.
saudet
December 1, 2020, 12:38pm
5
You probably won’t be able to load with beta6 models made with beta7, no. Please use beta7.
lavajaw
December 1, 2020, 12:42pm
6
I think that @saudet linked this Switch to static linking for Android by sshepel · Pull Request #472 · KonduitAI/deeplearning4j · GitHub as solution for problem on android.
But to use it I need to use snapshots:
deeplearning4j-examples/README.md at master · eclipse/deeplearning4j-examples · GitHub
Here you have known issues with android.
But:
mvn dependency:get -DremoteRepositories=snapshots::::https://oss.sonatype.org/content/repositories/snapshots -Dartifact=org.nd4j:nd4j-native:1.0.0-SNAPSHOT:jar:android-arm64
this jar is missing.
Maybe I am missing something
lavajaw
December 2, 2020, 10:42am
7
@agibsonccc @saudet should I open new topic for this?
saudet
December 2, 2020, 11:41am
8
It’s still possible to use beta7 in Android, see
If you bundle libc++_shared.so in your app, it should work with beta7.
@saudet @agibsonccc yes I tried that. I added libc++_shared.so in jniLibs and its working, but when I run that model on android device it returns array of NaN:
INDArray output = ((ComputationGraph) neuralNetwork).output(indArray.dup());
output[0] is array od NaN.
Same model working fine on windows10, same lib version beta7, model trained on beta7.
Same code is running on windows and android.
@lavajaw could you tell us a bit about the android and arm version there?
lavajaw
December 3, 2020, 9:17am
11
@agibsonccc @saudet This is device:
Samsung Galaxy Tab S3 9.7 Android tablet. Announced Feb 2017. Features 9.7″ display, Snapdragon 820 chipset, 13 MP primary camera, 5 MP front camera, 6000 mAh battery, 128 GB storage, 4 GB RAM.
It has android 9 currently. Models trained on beta5, beta6 working fine on device (application has beta5 and beta6 versions of dl4j lib).
thanks @lavajaw
Could you use this app to inform us of your android sdk and device cpu
CPU-Z - Apps on Google Play
or if you are a developer and have platform tools you can get it from a device directly connected through USB by using ADB :
adb.exe shell # or ./adb shell
getprop | grep sdk
getprop | grep cpu
lavajaw
December 3, 2020, 9:44am
13
lavajaw
December 3, 2020, 10:46am
15
@quickwritereader yes, I tried:
# Eclipse Deeplearning4J Examples for Android
This project shows a simple example of using Deeplearning4J in an Android application. As Gradle is the preferred build tool for Android, this project uses Gradle instead of Maven.
The neural networks shown in this example are the same as are used in the [Moon](../dl4j-examples/src/main/java/org/deeplearning4j/examples/quickstart/modeling/feedforward/classification/MoonClassifier.java) and [Saturn](../dl4j-examples/src/main/java/org/deeplearning4j/examples/quickstart/modeling/feedforward/classification/SaturnClassifier.java) examples of the dl4j-examples.
The build configuration for Android can be found in [app/build.gradle](./app/build.gradle).
[Go back](../README.md) to the main repository page to explore other features/functionality of the **Eclipse Deeplearning4J** ecosystem. File an issue [here](https://github.com/eclipse/deeplearning4j/issues) to request new features.
```
mvn dependency:get -DremoteRepositories=snapshots::::https://oss.sonatype.org/content/repositories/snapshots -Dartifact=org.nd4j:nd4j-native:1.0.0-SNAPSHOT:jar:android-arm
mvn dependency:get -DremoteRepositories=snapshots::::https://oss.sonatype.org/content/repositories/snapshots -Dartifact=org.nd4j:nd4j-native:1.0.0-SNAPSHOT:jar:android-arm64
mvn dependency:get -DremoteRepositories=snapshots::::https://oss.sonatype.org/content/repositories/snapshots -Dartifact=org.nd4j:nd4j-native:1.0.0-SNAPSHOT:jar:android-x86
mvn dependency:get -DremoteRepositories=snapshots::::https://oss.sonatype.org/content/repositories/snapshots -Dartifact=org.nd4j:nd4j-native:1.0.0-SNAPSHOT:jar:android-x86_64
```
also saw this issue and tried to download:
org.nd4j:nd4j-native:1.0.0-SNAPSHOT:jar:android-arm64 but it doesn’t exist.
Check here:
https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.nd4j&a=nd4j-native&v=1.0.0-SNAPSHOT&e=jar&c=android-arm64
thanks @lavajaw
I’ll check if I’m able to run Linux based arms on the device. android specific ones are missing
lavajaw
December 3, 2020, 11:12am
17
@quickwritereader yes, someone forgot to generate them?
What should I do now?
lavajaw
December 3, 2020, 11:21am
19
@quickwritereader ok i will try but first sentence doesn’t look promising
https://deeplearning4j.konduit.ai/getting-started/build-from-source
Note: This guide is outdated. We are working on updating it as soon as possible.