ivy dependency not working on windows or linux, native TF code not found on classpath
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- java
- 領域
- build-system
研究方向
從 Ivy 相依性宣告和列出的三個 TensorFlow 0.4.2 jars 開始,接著沿著從 org.tensorflow.NativeLibrary.load 經過 org.bytedeco.javacpp.Loader.load 的堆疊追蹤進行檢查。檢查為什麼平台原生 artifacts 沒有在 classpath 上暴露 org.tensorflow.internal.c_api。對於回報的平台,所需的原生相依性已能解析,且 SavedModelBundle 初始化不再引發 ClassNotFoundException,即表示完成。
由索引模型根據 Issue 內容生成。
描述
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
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04 x86_64): Linux Ubuntu 23.04_ x86_64
- TensorFlow installed from (source or binary): binary
- TensorFlow version: 0.4.2
- Java version (i.e., the output of
java -version): 1.8.1 - Java command line flags (e.g., GC parameters):
- Installed from Maven Central?: Yes, via ivy
- Bazel version (if compiling from source):
- GCC/Compiler version (if compiling from source):
- CUDA/cuDNN version:
- GPU model and memory:
Describe 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:
<dependency org="org.tensorflow" name="tensorflow-core-api" rev="0.4.2" m:classifier="linux-x86_64-gpu"/>
<dependency org="org.tensorflow" name="tensorflow-core-api" rev="0.4.2" m:classifier="windows-x86_64-gpu"/>
<dependency org="org.tensorflow" name="tensorflow-core-api" rev="0.4.2"/>
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:
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)
at net.sf.jaer.eventprocessing.filter.MLPNoiseFilter.loadNetwork(MLPNoiseFilter.java:720)
at net.sf.jaer.eventprocessing.filter.MLPNoiseFilter.initFilter(MLPNoiseFilter.java:550)
at net.sf.jaer.eventprocessing.filter.NoiseTesterFilter.initFilter(NoiseTesterFilter.java:1073)
at net.sf.jaer.eventprocessing.FilterChain.initFilters(FilterChain.java:454)
at net.sf.jaer.graphics.AEViewer.setChip(AEViewer.java:5863)
at net.sf.jaer.graphics.AEViewer.constructChip(AEViewer.java:1020)
at net.sf.jaer.graphics.AEViewer.setAeChipClass(AEViewer.java:928)
at net.sf.jaer.graphics.AEViewer.<init>(AEViewer.java:520)
at net.sf.jaer.JAERViewer$RunningThread.run(JAERViewer.java:231)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.ClassNotFoundException: org.tensorflow.internal.c_api
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.bytedeco.javacpp.Loader.load(Loader.java:913)
... 29 more
Here is the screenshot showing contents of the linux native jar:
- 主要語言
- Java
- 星號
- 927
- 分支
- 227
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
tensorflow/java 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 65/100
tensorflow/java#653 · 1 則留言 · 4 個 reaction ·
-
難度 5/5 一週以上 新手友好度 25/100
tensorflow/java#621 · 4 則留言 ·
-
難度 5/5 一週以上 新手友好度 25/100
tensorflow/java#617 · 3 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 55/100
tensorflow/java#615 · 1 則留言 ·
-
難度 5/5 一週以上 新手友好度 25/100
tensorflow/java#614 · 1 則留言 ·
相似的 Issue
-
[Bug] Logo style setting missing and `classic` style not applied across multiple platforms (v3.1.0)未關閉
難度 2/5 1-3 小時 新手友好度 75/100
Stirling-Tools/Stirling-PDF#8382 · 1 個 reaction ·
維護者通常 2 天內回覆
-
難度 1/5 1 小時以內 新手友好度 70/100
維護者通常 4 天內回覆
-
enhancement untriaged
難度 2/5 1-3 小時 新手友好度 78/100
opensearch-project/sql#5842 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
openhab/openhab-addons#21882 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
YunaiV/ruoyi-vue-pro#1273 ·
維護者通常 3 天內回覆