'Failed to load MXNet native library' - Problem when trying DeepJavaLibrary OFF the internet! #1212
-
Hi, I'm trying to evaluate DeepJavaLibrary and to integrate it with a Java-application of mine which is developed OFF the internet. I.e. my development environment cannot download/communicate with internet repositories and so on. (NOTE! This question relates a bit to #921). Here is what I am trying to do:
On my internet-connected Windows computer, I created a new simple Gradle project with only ObjectDetection.java as code (renamed ObjDetection for separation only). I added referenced libraries ('Add external JARs ...) until the project could compile and run. Instead of referencing Eclipse-projects, I added corresponding built jar-files (SNAPSHOT-jars). This works fine!
Best regards, NotAGolfer 8< --- error trace from Eclipse consol Exception in thread "main" ai.djl.engine.EngineException: Failed to load MXNet native library |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
If you only need CPU on Windows, the solutions is pretty straightforward. What you need is just include the following dependency:
And remove See: https://docs.djl.ai/master/mxnet/mxnet-engine/index.html#windows-cpu You can then use the following command to generate redistribution zip file (you need change build.gradle in example:
The above command will create a zip file in |
Beta Was this translation helpful? Give feedback.
-
The failure is due to you are using a model from our model zoo. Since you don't have network access, you have to load a model from your local file system. see: https://docs.djl.ai/master/docs/load_model.html#load-models-from-the-local-file-system |
Beta Was this translation helpful? Give feedback.
-
@frankfliu , I realize one of the ideas with the Model Zoo is to be able to DOWNLOAD (and upload) appropriate models for an application ... and be ON the internet! However, is there anywhere in the Git Hub example directory tree where I can download a pretrained MXnet model that works with the ObjectDetection.java example? The purpose for that would be to show (me and others) how to load locally stored models for OFF-LINE applications. I do too realize I maybe should study the TrainMnist.java example more on how to create my fist model ... and load it. But there is still an idea to incorporate the Criteria example mentioned in the above link (and below), in a distributed example since the same pattern is not used by the ImageClassification.java example. `Criteria<Image, Classifications> criteria = Criteria.builder() ZooModel<Image, Classifications> model = criteria.loadModel();` Best regards! |
Beta Was this translation helpful? Give feedback.
-
I realized (after actually reading more about Deep Java Library) that I can used the cached model files and transfer them to the off-the-internet computer. That works for a proof-of-concept-integration of DJL! Thank you for helping me forward! |
Beta Was this translation helpful? Give feedback.
-
You can download MXNet model from our S3 bucket (or directly from MXNet model zoo). for example - ssd (resnet50):
Or you can download .zip file from our demo s3 bucket:
When you loading model from local file system you need specify translator:
|
Beta Was this translation helpful? Give feedback.
You can download MXNet model from our S3 bucket (or directly from MXNet model zoo). for example - ssd (resnet50):
Or you can download .zip file from our demo s3 bucket:
When you loading model from local file system you need specify translator: