eaplatanios / tensorflow_scala

TensorFlow API for the Scala Programming Language
http://platanios.org/tensorflow_scala/
Apache License 2.0
936 stars 96 forks source link

0.1.1 broken on OSX; ships Linux TensorFlow binaries #73

Closed sbrunk closed 6 years ago

sbrunk commented 6 years ago

I just tried to update to 0.1.1-SNAPSHOT on OSX, resulting in the following error:

[error]   Reason: no suitable image found.  Did find:
[error]         /private/var/folders/74/y5zh_njx423d78dnjjpg3p300000gn/T/tensorflow_scala_native_libraries49902698254112176/libtensorflow.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00

So I took quick look at the binaries extracted from the jar, and they seem to be Linux binaries:

$ file libtensorflow.so 
libtensorflow.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=7bd53c8eb71b625e3f3666e47f4fc9603b875039, stripped

In fact, it seems both darwin-cpu-x86_64.jar and linux-cpu-x86_64.jar are identical.

0.1.0 works perfectly on OSX, so I guess there's some glitch in the new build process.

sbrunk commented 6 years ago

I compiled TensorFlow (1.5.0-rc1 and 1.5.0 final) myself, like so:

bazel build --config=opt //tensorflow:libtensorflow.so --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"

Now I get the following error:

...
[error] Caused by: org.platanios.tensorflow.jni.NotFoundException: dlopen(/var/folders/74/y5zh_njx423d78dnjjpg3p300000gn/T/tensorflow_scala_native_libraries5165700860649143930/libtensorflow_ops.so, 6): Symbol not found: __ZN10tensorflow15OpKernelContext10CtxFailureEPKciRKNS_6StatusE
...

If I try to compile the TF Scala project using those TF binaries, I get the same error as @lucaRadicalbit in #71

eaplatanios commented 6 years ago

@sbrunk This has been fixed in the last snapshot and I'll publish a 0.1.1 release tomorrow. :)

sbrunk commented 6 years ago

Awesome, works like a charm now with the 0.1.1 release. Thanks :)