question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EngineException when running in GraalVM Native Image

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:28 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
frankfliucommented, Jul 15, 2020

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

0reactions
frankfliucommented, Aug 13, 2020

DJL with tensorflow engine is work with quarkus now. see: https://github.com/aws-samples/djl-demo/tree/master/quarkus

Read more comments on GitHub >

github_iconTop Results From Across the Web

EngineException when running in GraalVM Native Image #103
I am able to compile and run in Native, but the TensorFlow libs are not being loaded correctly. 15:13:30,448 WARN [ai.djl.ten.eng.TfEngine] ...
Read more >
Native Image - GraalVM
Native Image is a technology to ahead-of-time compile Java code to a standalone executable, called a native image. This executable includes the application ......
Read more >
Native Image Compatibility and Optimization Guide - GraalVM
If the native image building cis unable to optimize an application, it generates a so-called “fallback file” that requires a Java VM to...
Read more >
Getting Started - GraalVM
First, the native-image tool performs static analysis of your code to determine the classes and methods that are reachable when your application runs....
Read more >
Native Image Options - GraalVM
Run native -image --help to get the commands overview, and native-image --help-extra to print help on non-standard and macro options.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found