JsonMappingException

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)

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 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.

You probably won’t be able to load with beta6 models made with beta7, no. Please use beta7.

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 :frowning:

@agibsonccc @saudet should I open new topic for this?

It’s still possible to use beta7 in Android, see

@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?

@agibsonccc @saudet This is device:

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

@quickwritereader thanks!

@lavajaw
so you have tried deeplearning4j-examples/android-examples at master · eclipse/deeplearning4j-examples (github.com) but it still did not work for you?

@quickwritereader yes, I tried:

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

@quickwritereader yes, someone forgot to generate them?
What should I do now?

well at the end of the day it is opensource.
you can cross-build that stack on android by yourself following “build from the source guide”.
eclipse/deeplearning4j: Eclipse Deeplearning4j, ND4J, DataVec and more - deep learning & linear algebra for Java/Scala with GPUs + Spark (github.com)

@quickwritereader ok i will try :slight_smile: but first sentence doesn’t look promising :smiley:

https://deeplearning4j.konduit.ai/getting-started/build-from-source

Note: This guide is outdated. We are working on updating it as soon as possible.

here is Android section:
deeplearning4j/libnd4j at master · eclipse/deeplearning4j (github.com)