djl: EngineException when running in GraalVM Native Image

Description

Please see this updated project: https://github.com/murphye/djl-demo/blob/master/pneumonia-detection-quarkus/README.md

I have two endpoints:

/detect will attempt to run the model, and will fail with the following error:

Caused by: ai.djl.engine.EngineException: No deep learning engine found.
Please refer to https://github.com/awslabs/djl/blob/master/docs/development/troubleshooting.md for more details.
        at ai.djl.engine.Engine.getInstance(Engine.java:90)
        at ai.djl.repository.zoo.Criteria$Builder.<init>(Criteria.java:193)
        at ai.djl.repository.zoo.Criteria.builder(Criteria.java:173)
        at com.example.ExampleResource.detect(ExampleResource.java:45)

/check will print out information showing that the TensorFlow Engine has been loaded properly.

>>>>>>>> ZooProvider: ai.djl.repository.zoo.DefaultZooProvider [models/saved_model:ai.djl.localmodelzoo:saved_model [
        ai.djl.localmodelzoo:saved_model:N/A {}

]]
>>>>>>>> Engine: TensorFlow

There is a contradiction of information here as TensorFlow Engine is loading, but still doesn’t work. This only occurs when running in Native mode, as JVM mode is OK

I am not sure how to proceed. I suggest trying to add more debugging info to DJL to understand what is happening. Quarkus team will have debugger support soon.

How to Reproduce?

See instructions https://github.com/murphye/djl-demo/blob/master/pneumonia-detection-quarkus/README.md

Run the two endpoints and observe the logs.

What have you tried to solve it?

These configs enable the ServiceLoader mechanism:

  1. https://github.com/murphye/djl-demo/blob/master/pneumonia-detection-quarkus/src/main/resources/reflection-config.json
  2. https://github.com/murphye/djl-demo/blob/master/pneumonia-detection-quarkus/src/main/resources/resources-config.json

Also see https://github.com/murphye/djl-demo/blob/master/pneumonia-detection-quarkus/src/main/resources/application.properties

Environment Info

Using Maven rather than Gradle as it provides error messages that Gradle does not for Native compilation. Using Mac and GraalVM 20.1.0 with Quarkus 1.5.1.Final

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 28 (12 by maintainers)

Commits related to this issue

Most upvoted comments

@murphye My college get the same 'No Java runtime present, requesting install." error on mac. I can try your solution and take a look model loading issue. I think the value of System.getProperty(“user.home”) is initialized at build time and the value is configured at “/work” in your docker, but this folder doesn’t exist at runtime.