java icon indicating copy to clipboard operation
java copied to clipboard

Issue with loading model from: tensorflow_decision_forests

Open zYeee opened this issue 2 years ago • 6 comments
trafficstars

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!

zYeee avatar Apr 12 '23 09:04 zYeee

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

Craigacp avatar Apr 12 '23 11:04 Craigacp

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

zYeee avatar Apr 13 '23 02:04 zYeee

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.

Craigacp avatar Apr 13 '23 13:04 Craigacp

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 avatar Apr 14 '23 03:04 zYeee

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

zYeee avatar Apr 14 '23 03:04 zYeee

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

Craigacp avatar May 10 '24 19:05 Craigacp