Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TensorFlow] No Java runtime present, requesting install #417

Closed
stu1130 opened this issue Jul 27, 2020 · 14 comments
Closed

[TensorFlow] No Java runtime present, requesting install #417

stu1130 opened this issue Jul 27, 2020 · 14 comments
Labels

Comments

@stu1130
Copy link

stu1130 commented Jul 27, 2020

Environment

  1. Mac 10.14.6 (Mojave)
  2. GraalVM 20.1.0 Java 11

Step to reproduce:

1. install GraalVM following the [instruction](https://www.graalvm.org/docs/getting-started/macos)
2. git clone https://github.com/aws-samples/djl-demo.git
3. cd djl-demo/graalvm
4. mvn clean package -Pnative -Ptensorflow
5. target/image-classification
Loading:     100% |████████████████████████████████████████|
No Java runtime present, requesting install.

Screen Shot 2020-07-27 at 10 15 54 AM

DJL uses TensorFlow JavaCpp bindings.
When building GraalVM with native mode, it shouldn't look for java during the runtime
Does JavaCpp for TensorFlow override the path of which JVM is loading?

@stu1130 stu1130 changed the title No Java runtime present, requesting install [TensorFlow] No Java runtime present, requesting install Jul 27, 2020
@saudet
Copy link
Member

saudet commented Jul 28, 2020

Does the same thing happen with this sample project?
https://github.com/bytedeco/sample-projects/tree/master/opencv-stitching-native

@stu1130
Copy link
Author

stu1130 commented Jul 28, 2020

@saudet yes I got the same error

@saudet
Copy link
Member

saudet commented Jul 28, 2020

Hum, that's weird. It's not doing anything that should trigger something like that...
I wonder if that gets triggered when trying to link with JavaVM framework but not installed?
https://github.com/bytedeco/javacpp/blob/master/src/main/java/org/bytedeco/javacpp/tools/Builder.java#L187

@saudet
Copy link
Member

saudet commented Jul 28, 2020

Yeah, it looks like that means the JDK isn't installed on the system. I wonder how GraalVM's JDK should be installed as a framework on a Mac for this to work correctly...

@stu1130
Copy link
Author

stu1130 commented Jul 28, 2020

The weirdest part is that my colleague @frankfliu don't have such issue, but me and one of the engineer from RedHat have the same error #deepjavalibrary/djl#133
Do you have any insight on this @frankfliu ?

@saudet
Copy link
Member

saudet commented Jul 28, 2020

Oh, I see what's going on. Linking with the JavaVM framework actually makes it go look for libjvm.dylib, but it's not there unless the JDK is installed, which we don't need for the Java code after compiling everything AOT. Let me see how we can fix this...

@saudet
Copy link
Member

saudet commented Jul 29, 2020

I've fixed this in commit a59010d, but to have it applied to TensorFlow, we need to upgrade to JavaCPP 1.5.4-SNAPSHOT.
@karllessard Are you OK with adding dependencies on snapshots?

/cc @johanvos

@karllessard
Copy link

karllessard commented Jul 29, 2020

When are you planning to release it? As long as TF Java is only available as a snapshot, it's fine but a release would be certainly better (I'm a bit biased in my statement because I'm building at the moment on a platform having issues to download snapshots from OSS Sonatype, are JavaCPP snapshots deployed on this repo as well?)

@saudet
Copy link
Member

saudet commented Jul 29, 2020

Sonatype OSSRH as well, yes: http://bytedeco.org/builds/

What kind of issues are you having?

@karllessard
Copy link

For our readers, @saudet and I discussed in private with the problems I'm having with Sonatype but regarding this issue, I think we are good to try this JavaCPP snapshot in TensorFlow for Java.

@stu1130
Copy link
Author

stu1130 commented Jul 31, 2020

Thanks for the quick fix. @saudet
Is the patch available on 1.5.4-SNAPSHOT for macos?

@saudet
Copy link
Member

saudet commented Aug 1, 2020

Yes, see tensorflow/java#93

@stu1130
Copy link
Author

stu1130 commented Aug 12, 2020

Thanks! I verified the problem has been solved.

@stu1130 stu1130 closed this as completed Aug 12, 2020
@saudet
Copy link
Member

saudet commented Sep 10, 2020

Fix released with JavaCPP 1.5.4. Thanks for reporting this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants