Running a neural network model not working on hikey970 (HiAI DDK)

Hi all,

i will try to explain my problem as exact as possible.
First tl;dr:

  • I have a caffe model
  • it works flawlessly with HiAI DDK when I integrate it into the prebuilt app
  • it does not work, when I write my own C++ code, copying and translating the C++/JNI Code of the app

Now a bit more precise:
HiAI DDK comes with a Demo-App which has two neural network models for image recognition. When I execute this app on the hikey970, the neural networks do work and can correctly classify different images.
I managed to write my own neural network using caffe and integrated it into the app. This neural network also works flawlessly and behaves as expected.
Now for the next step, I wanted to try to write C+±Code and create a binary to run on the hikey via the adb shell. You see, all of the code used by the Demo-App to load and execute a neural network is C+±Code with the JNI (Java Native Interface) to run it inside an Android app.
I have basically copied the file “classify_jni.cpp” and translated it into pure C++ to get a binary. The binary can successfully load and unload the neural network model, but when I run the function “HIAI_ModelManager_runModel(…)” which is reference in “HiAIModelManager.h” and linked from “”, I get a return value of -1000, which indicates an error.

Does anybody have an idea what I could be missing?