tensorflow/java

Issue with loading model from: tensorflow_decision_forests

zYeee opened this issue · 6 comments

zYeee commented

hi team,
I'm encountering a similar issue with: #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!

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

zYeee commented

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

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

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

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

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