Hi,
I think I may have hit a show stopper. I added all the dependencies
required to run dl4j on Android. After a few hours of work (unusually
long for adding dependencies), I was finally able to build the
application successfully.
The size of the apk blew up to 1.8GB!!!
Not surprisingly, when I tried to install it on the device it failed.
I am pretty much stuck at this point. As I am sure you agree, a 1.8 GB
apk is not acceptable.
From a quick review of the dependencies, it’s pretty clear that adding
all of these (below) causes the problem coupled with the support of
“all” platforms under the sun (windows, android, x86, linux, arm,
arm64,…). I cannot eblieve that ALL inclusive dependencies are really
necessary. Why do I need windows and macos dependencies on an Android
device??
As I think you can guess, I am pretty frustrated by what packaging
choices which in my opinion do not reflect the reality of the Android
world. Unless I did something wrong, I would say that it is not correct
to say that dl4j supports Android. All my work of the past weeks appears
to have been wasted.
By the way, please keep in mind the my app does not just run a neural
network. And. you could not realistically expect that I remove all the
other functions to enable use of dl4j.
And, removing dependencies I do not need on Android devices is
impossible given how dl4j is packaged.
Any ideas for resolving this problem would be greatly appreciated.
Thanks you,
Alex
implementation (group: ‘org.deeplearning4j’, name:
‘deeplearning4j-core’, version: ‘{{page.version}}’) {
exclude group: ‘org.bytedeco’, module: ‘opencv-platform’
exclude group: ‘org.bytedeco’, module: ‘leptonica-platform’
exclude group: ‘org.bytedeco’, module: ‘hdf5-platform’
}
implementation group: ‘org.nd4j’, name: ‘nd4j-native’, version:
‘1.0.0-beta6’
implementation group: ‘org.nd4j’, name: ‘nd4j-native’, version:
‘1.0.0-beta6’, classifier: “android-arm”
implementation group: ‘org.nd4j’, name: ‘nd4j-native’, version:
‘1.0.0-beta6’, classifier: “android-arm64”
implementation group: ‘org.nd4j’, name: ‘nd4j-native’, version:
‘1.0.0-beta6’, classifier: “android-x86”
implementation group: ‘org.nd4j’, name: ‘nd4j-native’, version:
‘1.0.0-beta6’, classifier: “android-x86_64”
implementation group: ‘org.bytedeco’, name: ‘openblas’, version:
‘0.3.7-1.5.2’
implementation group: ‘org.bytedeco’, name: ‘openblas’, version:
‘0.3.7-1.5.2’, classifier: “android-arm”
implementation group: ‘org.bytedeco’, name: ‘openblas’, version:
‘0.3.7-1.5.2’, classifier: “android-arm64”
implementation group: ‘org.bytedeco’, name: ‘openblas’, version:
‘0.3.7-1.5.2’, classifier: “android-x86”
implementation group: ‘org.bytedeco’, name: ‘openblas’, version:
‘0.3.7-1.5.2’, classifier: “android-x86_64”
implementation group: ‘org.bytedeco’, name: ‘opencv’, version: ‘4.1.2-1.5.2’
implementation group: ‘org.bytedeco’, name: ‘opencv’, version:
‘4.1.2-1.5.2’, classifier: “android-arm”
implementation group: ‘org.bytedeco’, name: ‘opencv’, version:
‘4.1.2-1.5.2’, classifier: “android-arm64”
implementation group: ‘org.bytedeco’, name: ‘opencv’, version:
‘4.1.2-1.5.2’, classifier: “android-x86”
implementation group: ‘org.bytedeco’, name: ‘opencv’, version:
‘4.1.2-1.5.2’, classifier: “android-x86_64”
implementation group: ‘org.bytedeco’, name: ‘leptonica’, version:
‘1.78.0-1.5.2’
implementation group: ‘org.bytedeco’, name: ‘leptonica’, version:
‘1.78.0-1.5.2’, classifier: “android-arm”
implementation group: ‘org.bytedeco’, name: ‘leptonica’, version:
‘1.78.0-1.5.2’, classifier: “android-arm64”
implementation group: ‘org.bytedeco’, name: ‘leptonica’, version:
‘1.78.0-1.5.2’, classifier: “android-x86”
implementation group: ‘org.bytedeco’, name: ‘leptonica’, version:
‘1.78.0-1.5.2’, classifier: “android-x86_64”
testimplementation ‘junit:junit:4.12’