tensorflow: TensorFlow Error : java.lang.UnsatisfiedLinkError: Cannot find TensorFlow native library for OS: windows

Hello everyone I have this error when I compile my project tensorflow on netbeans

Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot find TensorFlow native library for OS: windows, architecture: x86. See https://github.com/tensorflow/tensorflow/tree/master/tensorflow/java/README.md for possible solutions (such as building the library from source). Additional information on attempts to find the native library can be obtained by adding org.tensorflow.NativeLibrary.DEBUG=1 to the system properties of the JVM.
 at org.tensorflow.NativeLibrary.load(NativeLibrary.java:77)
 at org.tensorflow.TensorFlow.init(TensorFlow.java:66) at org.tensorflow.TensorFlow.(TensorFlow.java:70)
 at org.tensorflow.Graph.(Graph.java:258) at HelloTF.main(HelloTF.java:8)
 C:\Users\HP Notebook\AppData\Local\NetBeans\Cache\8.2\executor-enter codeheresnippets\run.xml:53: Java returned: 1 BUILD FAILED (total time: 0 seconds)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

When you have tensor flow dependency in your pom.xml file as below

<dependencies> <dependency> <groupId>org.tensorflow</groupId> <artifactId>tensorflow</artifactId> <version>1.14.0</version> </dependency> It will download required 3 libraries tensorflow-1.14.0.jar libtensorflow-1.14.0.jar libtensorflow_jni-1.14.0.jar

So you have to manually extract the 3rd jar(libtensorflow_jni) and get your OS compatible file like for windows you have to copy the tensorflow_jni.dll file and paste in your project root directory that will solve your problem.