Open tobidelbruck opened 1 year ago
Do you have other TF-Java dependencies in Ivy? This is the tree I get when depending on TF-Java in Maven:
[INFO] | +- org.tensorflow:tensorflow-core-api:jar:0.5.0:compile
[INFO] | | +- org.bytedeco:javacpp:jar:1.5.8:compile
[INFO] | | \- org.tensorflow:ndarray:jar:0.4.0:compile
[INFO] | +- org.tensorflow:tensorflow-core-platform:jar:0.5.0:compile
[INFO] | | +- org.bytedeco:javacpp:jar:linux-x86_64:1.5.8:compile
[INFO] | | +- org.bytedeco:javacpp:jar:macosx-x86_64:1.5.8:compile
[INFO] | | +- org.bytedeco:javacpp:jar:windows-x86_64:1.5.8:compile
[INFO] | | +- org.tensorflow:tensorflow-core-api:jar:linux-x86_64:0.5.0:compile
[INFO] | | +- org.tensorflow:tensorflow-core-api:jar:macosx-x86_64:0.5.0:compile
[INFO] | | \- org.tensorflow:tensorflow-core-api:jar:windows-x86_64:0.5.0:compile
[INFO] | \- org.tensorflow:tensorflow-framework:jar:0.5.0:compile
Thanks for quick response! I added the other dependences you have explictly and see they got downloaded, and they are newer than some I had so evicted the older ones:
I deleted some unrelated dependencies in the ivy output below:
ant -f "F:\\tobi\\Dropbox (Personal)\\GitHub\\SensorsINI\\jaer" -Dnb.internal.action.name=run run
download-deps:
:: Apache Ivy 2.4.0 - 20141213170938 :: http://ant.apache.org/ivy/ ::
:: loading settings :: file = F:\tobi\Dropbox (Personal)\GitHub\SensorsINI\jaer\ivysettings.xml
:: resolving dependencies :: org.jaerproject#jaer;working@tobi-joule-amd
confs: [default]
found org.bytedeco.javacpp-presets#hdf5;1.10.1-1.4 in public
found org.bytedeco.javacpp-presets#opencv;3.2.0-1.3 in public
found org.bytedeco#javacv;1.0 in public
found org.bytedeco.javacpp-presets#ffmpeg;2.7.1-1.0 in public
found org.bytedeco.javacpp-presets#flycapture;2.7.3.19-1.0 in public
found org.bytedeco.javacpp-presets#libdc1394;2.2.3-1.0 in public
found org.bytedeco.javacpp-presets#libfreenect;0.5.2-1.0 in public
found org.bytedeco.javacpp-presets#videoinput;0.200-1.0 in public
found org.bytedeco.javacpp-presets#artoolkitplus;2.3.1-1.0 in public
found org.bytedeco.javacpp-presets#flandmark;1.07-1.0 in public
found org.tensorflow#tensorflow-core-api;0.4.2 in public
found com.google.protobuf#protobuf-java;3.19.4 in public
found org.tensorflow#tensorflow-core-api;0.4.2 in public
[0.4.2] org.tensorflow#tensorflow-core-api;0.4.2
found org.tensorflow#tensorflow-core-platform-gpu;0.4.2 in public
found org.tensorflow#ndarray;0.4.0 in public
found org.bytedeco#javacpp;1.5.8 in public
[1.5.8] org.bytedeco#javacpp;1.5.8
:: resolution report :: resolve 951ms :: artifacts dl 72ms
:: evicted modules:
org.bytedeco#javacpp;1.4 by [org.bytedeco#javacpp;1.5.8] in [default]
org.bytedeco#javacpp;1.3 by [org.bytedeco#javacpp;1.5.8] in [default]
org.bytedeco#javacpp;1.0 by [org.bytedeco#javacpp;1.5.8] in [default]
org.bytedeco.javacpp-presets#opencv;3.0.0-1.0 by [org.bytedeco.javacpp-presets#opencv;3.2.0-1.3] in [default]
org.bytedeco#javacpp;1.5.6 by [org.bytedeco#javacpp;1.5.8] in [default]
org.tensorflow#ndarray;0.3.3 by [org.tensorflow#ndarray;0.4.0] in [default]
But I get the same missing native code hook errors.
WARNING: java.lang.NoClassDefFoundError: java.lang.ClassNotFoundException: org.tensorflow.internal.c_api
at org.bytedeco.javacpp.Loader.load(Loader.java:918)
at org.bytedeco.javacpp.Loader.load(Loader.java:870)
at org.tensorflow.NativeLibrary.load(NativeLibrary.java:48)
at org.tensorflow.TensorFlow.<clinit>(TensorFlow.java:156)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.tensorflow.SavedModelBundle.<clinit>(SavedModelBundle.java:651)
That stack trace is weird because Loader.java
line 870 in JavaCPP 1.5.8 is Loader.findResources
not Loader.load
- https://github.com/bytedeco/javacpp/blob/1.5.8/src/main/java/org/bytedeco/javacpp/Loader.java#L870. Do you have multiple versions of JavaCPP on the classpath?
Thanks very much for your insights! I have no idea about class loaders or bytedeco. Let me dig deeper. I probably do have multiple versions resulting from opencv and jogl use in this project. And there may be even more javacpp in the static jars we must include (since libs not available by maven central). It may be that we are ignorant of best practices. I'll let you know what I find out.
@tobidelbruck Please upgrade TensorFlow, JavaCV, OpenCV, HDF5, and any others with a dependency on JavaCPP, to their latest versions.
Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template
System information
java -version
): 1.8.1Describe the problem I'm trying to use tensorflow 2 with ivy.xml in java project. The problem is that the maven download is not complete. It only downloads either 1. no native platform, or 2. if I specify 2 platforms (windows and linux), it only downloads one of them. AND 3. when I manually download the relevant jars, it cannot find the native hooks.
Provide the exact sequence of commands / steps that you executed before running into the problem I first tried ivy using these dependencies in various combinations, each time making sure to delete existing tensorflow jars from my ivy local cache folder:
Since this did not work (I never got the full set of native jars), I downloaded the jars and put them in my local project jars folder, which is on the classpath. jars/tensorflow-core-api-0.4.2.jar jars/tensorflow-core-api-0.4.2-linux-x86_64-gpu.jar jars/tensorflow-core-api-0.4.2-windows-x86_64-gpu.jar
These jars are added to the project classpath in netbeans 8.2 project dialog
Any other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
Here is the log output:
Here is the screenshot showing contents of the linux native jar: