tensorflow / java

Java bindings for TensorFlow
Apache License 2.0
807 stars 198 forks source link

Issue with loading model from: tensorflow_decision_forests #492

Open zYeee opened 1 year ago

zYeee commented 1 year ago

hi team, I'm encountering a similar issue with: https://github.com/tensorflow/java/issues/480 When I tried to load val opList = TensorFlow.loadLibrary(this::class.java.getResource("/inference.so")!!.path), I can see the exception like:

app {-tdh44/load-model#GET] Unhandled exception from a service:","args":[{"cancelled":false,"timedOut":false}],"exception":"java.lang.UnsatisfiedLinkError: /app/resources/inference.so: undefi │
│ ned symbol: _ZN10tensorflow6StatusC1ENS_5error4CodeEN4absl12lts_2021032411string_viewEOSt6vectorINS_10StackFrameESaIS7_EE\n"}

Could anyone help to take a look? Thanks in advance!

Craigacp commented 1 year ago

What versions of TF-Java and TF decision forests are you using? And what platform are you running on?

zYeee commented 1 year ago

What versions of TF-Java and TF decision forests are you using? And what platform are you running on?

thanks for responding @Craigacp , Now we only use the dependency of org.tensorflow:tensorflow-core-platform:0.5.0 and tfdf version is 0.2.4

Should I add another dependency that includes TF-Java?

And we execute our app in docker container: gradle:7.4.2-jdk17, the base image is ubuntu:22.04

Craigacp commented 1 year ago

Looks like that TFDF version is pretty old. Try using the 1.0.1 release, that should be compatible with TF 2.10 which is the version built into TF-Java 0.5.0.

zYeee commented 1 year ago

Looks like that TFDF version is pretty old. Try using the 1.0.1 release, that should be compatible with TF 2.10 which is the version built into TF-Java 0.5.0.

I also tried the latest version of tfdf: https://pypi.org/project/tensorflow-decision-forests/#files still saw the error

zYeee commented 1 year ago

just tried the tfdf version: 1.0.1: https://pypi.org/project/tensorflow-decision-forests/1.0.1/, still saw the error: undefined symbol: _ZNK10tensorflow8OpKernel11TraceStringB5cxx11ERKNS_15OpKernelContextEb

Craigacp commented 3 months ago

We've moved to using the latest binaries from tensorflow so this should work better now, without symbol mismatches.