我只是仔細一看。
簡單地添加依賴到org.tensorflow:tensorflow:1.4.0-rc0
(或任何你喜歡的版本)到你最喜歡的構建工具。
這將引入對org.tensorflow:libtensorflow_jni:1.4.0-rc0
的依賴。這將包括以下內容:
[email protected]:~$ unzip -t .m2/repository/org/tensorflow/libtensorflow_jni/1.4.0-rc0/libtensorflow_jni-1.4.0-rc0.jar
Archive: .m2/repository/org/tensorflow/libtensorflow_jni/1.4.0-rc0/libtensorflow_jni-1.4.0-rc0.jar
testing: META-INF/ OK
testing: META-INF/MANIFEST.MF OK
testing: org/ OK
testing: org/tensorflow/ OK
testing: org/tensorflow/native/ OK
testing: org/tensorflow/native/darwin-x86_64/ OK
testing: org/tensorflow/native/linux-x86_64/ OK
testing: org/tensorflow/native/windows-x86_64/ OK
testing: org/tensorflow/native/darwin-x86_64/libtensorflow_framework.so OK
testing: org/tensorflow/native/darwin-x86_64/LICENSE OK
testing: org/tensorflow/native/darwin-x86_64/libtensorflow_jni.dylib OK
testing: org/tensorflow/native/linux-x86_64/libtensorflow_framework.so OK
testing: org/tensorflow/native/linux-x86_64/libtensorflow_jni.so OK
testing: org/tensorflow/native/linux-x86_64/LICENSE OK
testing: org/tensorflow/native/windows-x86_64/tensorflow_jni.dll OK
testing: org/tensorflow/native/windows-x86_64/LICENSE OK
testing: META-INF/maven/ OK
testing: META-INF/maven/org.tensorflow/ OK
testing: META-INF/maven/org.tensorflow/libtensorflow_jni/ OK
testing: META-INF/maven/org.tensorflow/libtensorflow_jni/pom.xml OK
testing: META-INF/maven/org.tensorflow/libtensorflow_jni/pom.properties OK
No errors detected in compressed data of .m2/repository/org/tensorflow/libtensorflow_jni/1.4.0-rc0/libtensorflow_jni-1.4.0-rc0.jar.
正如你可以看到這已經包含了所有需要的二進制文件以獲得JNI工作的所有正式支持的平臺上。它包含x86_64上的任何Linux。
只要你不嘗試在raspi或32位CentOS上使用它,只要你使用合適的構建工具,你應該保存。
唯一的風險在於這些庫依賴於其他系統庫。在libtensorflow_framework.so
到ldd
呼叫顯示:
[email protected]:~$ ldd org/tensorflow/native/linux-x86_64/libtensorflow_framework.so
linux-vdso.so.1 => (0x00007ffffaa62000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f07c6494000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f07c6290000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f07c6073000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f07c5cf0000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f07c5ada000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f07c5710000)
/lib64/ld-linux-x86-64.so.2 (0x000056525c661000)
如果你沒有找到你的系統上,這些傳遞依賴你應該嘗試tensorflow的或舊版本的CentOS的更新。
您必須像在Windows上一樣提供jni庫。該庫必須放置在你用'-Djava.library.path = ...'指定的路徑上。單一區別:該庫被命名爲'lib.so',而不是'lib.dll'。您的問題或鏈接都不會告訴我們哪個庫。所以我們不能告訴你要安裝哪個軟件包。 – blafasel