tensorflow / tensorflow/java

Simple Project Not Working

Open
#374 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
928
Forks
227
PR merge metrics
No merged PRs in 30d

Description

Host description

  • OS: Windows 10
  • Memory: 16GB
  • CPU: Intel i7 8700
  • GPU: Nvidia GeForece RTX 2080
  • Java Version: 8

Simple project to replicate the problem

Problem description

The main method is straight out of the docs here. I can't seem to make it work. My main language of choice is Scala. I was trying to make it work in sbt and was getting a similar exception. From what I searched on the internet, it seems to be a JavaCPP error (missing *-platform). I don't think I'm doing anything wrong as I copied the example project. Please correct my if I'm wrong.

Warning: Could not load Loader: java.lang.UnsatisfiedLinkError: no jnijavacpp in java.library.path
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jnitensorflow in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
	at java.lang.Runtime.loadLibrary0(Runtime.java:871)
	at java.lang.System.loadLibrary(System.java:1122)
	at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1683)
	at org.bytedeco.javacpp.Loader.load(Loader.java:1300)
	at org.bytedeco.javacpp.Loader.load(Loader.java:1123)
	at org.tensorflow.internal.c_api.global.tensorflow.<clinit>(tensorflow.java:12)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at org.bytedeco.javacpp.Loader.load(Loader.java:1190)
	at org.bytedeco.javacpp.Loader.load(Loader.java:1139)
	at org.tensorflow.NativeLibrary.load(NativeLibrary.java:48)
	at org.tensorflow.TensorFlow.init(TensorFlow.java:111)
	at org.tensorflow.TensorFlow.<clinit>(TensorFlow.java:126)
	at my.project.App.main(App.java:19)
Caused by: java.lang.UnsatisfiedLinkError: no tensorflow_cc in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
	at java.lang.Runtime.loadLibrary0(Runtime.java:871)
	at java.lang.System.loadLibrary(System.java:1122)
	at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1683)
	at org.bytedeco.javacpp.Loader.load(Loader.java:1227)
	... 10 more

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction project and the TensorFlow JVM install example, then reproduce the failure from App.java line 19 on Windows with Java 8. Trace the reported NativeLibrary.load and TensorFlow.init calls; done means the example starts without the jnijavacpp, jnitensorflow, and tensorflow_cc UnsatisfiedLinkError failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.